To solve this problem we need to know the contents of mp_SchemaVersion and mp_SchemaScriptHistory tables
Whatever version is the highest version for mojoportal-core in mp_SchemaScriptHistory, the same version needs to be in mp_SchemaVersion so that it only tries to run newer scripts. it should never run the script 2.2.1.9 unless upgrading from a very very old version of mojoPortal. Something is not correct in the mp_SchemaVersion table so it is trying to run old scripts that it should not try to run.