migration: add missing column checks (fix #845)

Signed-off-by: Varun Patil <radialapps@gmail.com>
pull/807/merge
Varun Patil 2023-10-06 15:14:16 -07:00
parent 14941a6c43
commit 12bd8823e7
2 changed files with 13 additions and 9 deletions

View File

@ -56,10 +56,12 @@ class Version505000Date20230821044807 extends SimpleMigrationStep
$schema = $schemaClosure(); $schema = $schemaClosure();
$table = $schema->getTable('memories'); $table = $schema->getTable('memories');
$table->addColumn('epoch', Types::BIGINT, [ if (!$table->hasColumn('epoch')) {
'notnull' => true, $table->addColumn('epoch', Types::BIGINT, [
'default' => 0, 'notnull' => true,
]); 'default' => 0,
]);
}
return $schema; return $schema;
} }

View File

@ -44,11 +44,13 @@ class Version505004Date20231004200012 extends SimpleMigrationStep
$schema = $schemaClosure(); $schema = $schemaClosure();
$table = $schema->getTable('memories'); $table = $schema->getTable('memories');
$table->addColumn('buid', Types::STRING, [ if (!$table->hasColumn('buid')) {
'notnull' => false, $table->addColumn('buid', Types::STRING, [
'length' => 32, 'notnull' => false,
'default' => '', 'length' => 32,
]); 'default' => '',
]);
}
return $schema; return $schema;
} }