Skip to content

Commit

Permalink
Merge pull request #47125 from nextcloud/backport/47116/stable28
Browse files Browse the repository at this point in the history
[stable28] fix(migration): Add column only if it does not exist
  • Loading branch information
AndyScherzinger committed Aug 8, 2024
2 parents df821f6 + 4218e7f commit 22fa192
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 22fa192

Please sign in to comment.