fix: [migrations] initial schema migration fixed for upgrades

- check if a table has already been created and block the execution for instances that get updated from before the initial schema was retroactively added
cli-modification-summary
iglocska 2022-02-07 02:00:35 +01:00
parent 6a2b764b97
commit d1cdbda972
No known key found for this signature in database
GPG Key ID: BEA224F1FEF113AC
1 changed files with 4 additions and 0 deletions

View File

@ -9,6 +9,10 @@ class InitialSchema extends AbstractMigration
{
public function change()
{
$exists = $this->hasTable('broods');
if ($exists) {
return true;
}
$this->execute('SET unique_checks=0; SET foreign_key_checks=0;');
$this->execute("ALTER DATABASE CHARACTER SET 'utf8mb4';");
$this->execute("ALTER DATABASE COLLATE='utf8mb4_general_ci';");