aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGit'Fellow <12234510+solracsf@users.noreply.github.com>2024-10-01 08:12:11 +0200
committerbackportbot[bot] <backportbot[bot]@users.noreply.github.com>2024-10-01 13:19:01 +0000
commit45fd3d2fe3bb168f641a8366177f14e028ce990b (patch)
tree970780a823e3d1f015170466aa5c741ea1169aa6
parent8e093bd92f5fae2bb6e8a53a8242cbb80fd9513f (diff)
downloadnextcloud-server-backport/48480/stable30.tar.gz
nextcloud-server-backport/48480/stable30.zip
fix(migration): Check if column exits before adding itbackport/48480/stable30
Signed-off-by: Git'Fellow <12234510+solracsf@users.noreply.github.com>
-rw-r--r--core/Migrations/Version30000Date20240708160048.php36
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;
}