diff --git a/core/Migrations/Version30000Date20240717111406.php b/core/Migrations/Version30000Date20240717111406.php index 558ac43238706..549185cc9040c 100644 --- a/core/Migrations/Version30000Date20240717111406.php +++ b/core/Migrations/Version30000Date20240717111406.php @@ -32,24 +32,29 @@ class Version30000Date20240717111406 extends SimpleMigrationStep { public function changeSchema(IOutput $output, Closure $schemaClosure, array $options): ?ISchemaWrapper { /** @var ISchemaWrapper $schema */ $schema = $schemaClosure(); + $schemaChanged = false; if ($schema->hasTable('taskprocessing_tasks')) { $table = $schema->getTable('taskprocessing_tasks'); - $table->addColumn('webhook_uri', Types::STRING, [ - 'notnull' => false, - 'default' => null, - 'length' => 4000, - ]); - $table->addColumn('webhook_method', Types::STRING, [ - 'notnull' => false, - 'default' => null, - 'length' => 64, - ]); - - return $schema; + if (!$table->hasColumn('webhook_uri')) { + $table->addColumn('webhook_uri', Types::STRING, [ + 'notnull' => false, + 'default' => null, + 'length' => 4000, + ]); + $schemaChanged = true; + } + if (!$table->hasColumn('webhook_method')) { + $table->addColumn('webhook_method', Types::STRING, [ + 'notnull' => false, + 'default' => null, + 'length' => 64, + ]); + $schemaChanged = true; + } } - return null; + return $schemaChanged ? $schema : null; } }