Merge pull request #63350 from nextcloud/fix/noid/taskprocessing-webhook-migration

Fix one core migration: Only add taskprocessing columns if they don't exist
pull/63316/merge
Josh 1 day ago committed by GitHub
commit bcaf7e5646
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 31
      core/Migrations/Version30000Date20240717111406.php

@ -34,24 +34,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;
}
}

Loading…
Cancel
Save