summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndy Scherzinger <info@andy-scherzinger.de>2024-08-08 10:44:01 +0200
committerGitHub <noreply@github.com>2024-08-08 10:44:01 +0200
commit22fa192588409d350f83b6c42b18d41890c3283f (patch)
treeb4fdb5a3d6329e6f42e3948ab67629deece77917
parentdf821f60e402c0c8f1825fad40516d83faf968c4 (diff)
parent4218e7f6e4fc2ef96d868460612d11f2084cfda8 (diff)
downloadnextcloud-server-22fa192588409d350f83b6c42b18d41890c3283f.tar.gz
nextcloud-server-22fa192588409d350f83b6c42b18d41890c3283f.zip
Merge pull request #47125 from nextcloud/backport/47116/stable28
[stable28] fix(migration): Add column only if it does not exist
-rw-r--r--core/Migrations/Version13000Date20170718121200.php10
1 files changed, 6 insertions, 4 deletions
diff --git a/core/Migrations/Version13000Date20170718121200.php b/core/Migrations/Version13000Date20170718121200.php
index da83b0732d8..ebdbe41fa8b 100644
--- a/core/Migrations/Version13000Date20170718121200.php
+++ b/core/Migrations/Version13000Date20170718121200.php
@@ -150,10 +150,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');
}