diff options
author | Git'Fellow <12234510+solracsf@users.noreply.github.com> | 2024-10-01 08:12:11 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-10-01 08:12:11 +0200 |
commit | ffa19a9827b93817a64c2b9d737f19b7dc8bc88a (patch) | |
tree | 7bcc65fe54f3ea16e77231ea98696d656cc022c3 /core | |
parent | e2e5de8724e3af175cbf2d61052a47627b607520 (diff) | |
download | nextcloud-server-ffa19a9827b93817a64c2b9d737f19b7dc8bc88a.tar.gz nextcloud-server-ffa19a9827b93817a64c2b9d737f19b7dc8bc88a.zip |
fix(migration): Check if column exits before adding itcheckColExists
Signed-off-by: Git'Fellow <12234510+solracsf@users.noreply.github.com>
Diffstat (limited to 'core')
-rw-r--r-- | core/Migrations/Version30000Date20240708160048.php | 36 |
1 files changed, 21 insertions, 15 deletions
diff --git a/core/Migrations/Version30000Date20240708160048.php b/core/Migrations/Version30000Date20240708160048.php index 253b9cc7a64..83edd84e56a 100644 --- a/core/Migrations/Version30000Date20240708160048.php +++ b/core/Migrations/Version30000Date20240708160048.php @@ -37,21 +37,27 @@ class Version30000Date20240708160048 extends SimpleMigrationStep { if ($schema->hasTable('taskprocessing_tasks')) { $table = $schema->getTable('taskprocessing_tasks'); - $table->addColumn('scheduled_at', Types::INTEGER, [ - 'notnull' => false, - 'default' => null, - 'unsigned' => true, - ]); - $table->addColumn('started_at', Types::INTEGER, [ - 'notnull' => false, - 'default' => null, - 'unsigned' => true, - ]); - $table->addColumn('ended_at', Types::INTEGER, [ - 'notnull' => false, - 'default' => null, - 'unsigned' => true, - ]); + if (!$table->hasColumn('scheduled_at')) { + $table->addColumn('scheduled_at', Types::INTEGER, [ + 'notnull' => false, + 'default' => null, + 'unsigned' => true, + ]); + } + if (!$table->hasColumn('started_at')) { + $table->addColumn('started_at', Types::INTEGER, [ + 'notnull' => false, + 'default' => null, + 'unsigned' => true, + ]); + } + if (!$table->hasColumn('ended_at')) { + $table->addColumn('ended_at', Types::INTEGER, [ + 'notnull' => false, + 'default' => null, + 'unsigned' => true, + ]); + } return $schema; } |