Skip to content

Commit

Permalink
fix(install): prevent fatal error in migration
Browse files Browse the repository at this point in the history
  • Loading branch information
btry committed May 26, 2023
1 parent bc255ab commit b0b1571
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion install/install.php
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,7 @@ public function upgrade(Migration $migration, $args = []): bool {
}
}

$this->migration = $migration;
$oldVersion = Config::getConfigurationValue('formcreator', 'previous_version');
// Force fix of signed columns to reduce upgrade errors frequency
// This assumes that all modified columns exist in the database
Expand Down Expand Up @@ -185,7 +186,6 @@ public function upgrade(Migration $migration, $args = []): bool {
}
}

$this->migration = $migration;
if (isset($args['force-upgrade']) && $args['force-upgrade'] === true) {
// Might return false
$fromSchemaVersion = array_search(PLUGIN_FORMCREATOR_SCHEMA_VERSION, $this->upgradeSteps);
Expand Down Expand Up @@ -1024,5 +1024,7 @@ protected function migrateFkToUnsignedInt() {
}
$this->migration->changeField($table, 'id', 'id', 'int ' . DBConnection::getDefaultPrimaryKeySignOption() . ' not null auto_increment');
}

$this->migration->executeMigration();
}
}

0 comments on commit b0b1571

Please sign in to comment.