Skip to content

Commit

Permalink
Merge pull request #47116 from nextcloud/addColMigNotEx
Browse files Browse the repository at this point in the history
fix(migration): Add column if not exists
  • Loading branch information
solracsf authored Aug 8, 2024
2 parents 5f89477 + 3803e75 commit 5e5a51a
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions core/Migrations/Version13000Date20170718121200.php
Original file line number Diff line number Diff line change
Expand Up @@ -123,10 +123,12 @@ public function changeSchema(IOutput $output, \Closure $schemaClosure, array $op
$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');
}
Expand Down

0 comments on commit 5e5a51a

Please sign in to comment.