Skip to content

Commit

Permalink
Merge pull request #47126 from nextcloud/backport/47116/stable29
Browse files Browse the repository at this point in the history
[stable29] fix(migration): Add column only if it does not exist
  • Loading branch information
AndyScherzinger authored Aug 8, 2024
2 parents fe6e5fa + 11f163f commit 2d08bca
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 @@ -150,10 +150,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 2d08bca

Please sign in to comment.