Browse Source

fix(migration): Add column if not exists

Signed-off-by: Git'Fellow <12234510+solracsf@users.noreply.github.com>
pull/47116/head
Git'Fellow 1 year ago
committed by GitHub
parent
commit
3803e755af
No known key found for this signature in database GPG Key ID: B5690EEEBB952194
  1. 10
      core/Migrations/Version13000Date20170718121200.php

10
core/Migrations/Version13000Date20170718121200.php

@ -123,10 +123,12 @@ class Version13000Date20170718121200 extends SimpleMigrationStep {
$table->addIndex(['user_id', 'root_id', 'mount_point'], 'mounts_user_root_path_index', [], ['lengths' => [null, null, 128]]);
} else {
$table = $schema->getTable('mounts');
$table->addColumn('mount_id', Types::BIGINT, [
'notnull' => false,
'length' => 20,
]);
if (!$table->hasColumn('mount_id')) {
$table->addColumn('mount_id', Types::BIGINT, [
'notnull' => false,
'length' => 20,
]);
}
if (!$table->hasIndex('mounts_mount_id_index')) {
$table->addIndex(['mount_id'], 'mounts_mount_id_index');
}

Loading…
Cancel
Save