From 4218e7f6e4fc2ef96d868460612d11f2084cfda8 Mon Sep 17 00:00:00 2001 From: Git'Fellow <12234510+solracsf@users.noreply.github.com> Date: Wed, 7 Aug 2024 20:09:51 +0200 Subject: [PATCH] fix(migration): Add column if not exists Signed-off-by: Git'Fellow <12234510+solracsf@users.noreply.github.com> --- core/Migrations/Version13000Date20170718121200.php | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/core/Migrations/Version13000Date20170718121200.php b/core/Migrations/Version13000Date20170718121200.php index da83b0732d8a5..ebdbe41fa8bf3 100644 --- a/core/Migrations/Version13000Date20170718121200.php +++ b/core/Migrations/Version13000Date20170718121200.php @@ -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'); }