]> source.dussan.org Git - nextcloud-server.git/commitdiff
fix(migration): Add column if not exists 47125/head
authorGit'Fellow <12234510+solracsf@users.noreply.github.com>
Wed, 7 Aug 2024 18:09:51 +0000 (20:09 +0200)
committerbackportbot[bot] <backportbot[bot]@users.noreply.github.com>
Thu, 8 Aug 2024 07:54:46 +0000 (07:54 +0000)
Signed-off-by: Git'Fellow <12234510+solracsf@users.noreply.github.com>
core/Migrations/Version13000Date20170718121200.php

index da83b0732d8a5ece0718e0777e849a7bd4858611..ebdbe41fa8bf364fbd526fd34931b3e8d6321777 100644 (file)
@@ -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');
                        }