Skip to content

Commit e10152e

Browse files
authored
Merge pull request #63408 from nextcloud/backport/63350/stable30
[stable30] Fix one core migration: Only add taskprocessing columns if they don't exist
2 parents 56a5680 + 87303fe commit e10152e

1 file changed

Lines changed: 18 additions & 13 deletions

File tree

core/Migrations/Version30000Date20240717111406.php

Lines changed: 18 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -32,24 +32,29 @@ class Version30000Date20240717111406 extends SimpleMigrationStep {
3232
public function changeSchema(IOutput $output, Closure $schemaClosure, array $options): ?ISchemaWrapper {
3333
/** @var ISchemaWrapper $schema */
3434
$schema = $schemaClosure();
35+
$schemaChanged = false;
3536

3637
if ($schema->hasTable('taskprocessing_tasks')) {
3738
$table = $schema->getTable('taskprocessing_tasks');
3839

39-
$table->addColumn('webhook_uri', Types::STRING, [
40-
'notnull' => false,
41-
'default' => null,
42-
'length' => 4000,
43-
]);
44-
$table->addColumn('webhook_method', Types::STRING, [
45-
'notnull' => false,
46-
'default' => null,
47-
'length' => 64,
48-
]);
49-
50-
return $schema;
40+
if (!$table->hasColumn('webhook_uri')) {
41+
$table->addColumn('webhook_uri', Types::STRING, [
42+
'notnull' => false,
43+
'default' => null,
44+
'length' => 4000,
45+
]);
46+
$schemaChanged = true;
47+
}
48+
if (!$table->hasColumn('webhook_method')) {
49+
$table->addColumn('webhook_method', Types::STRING, [
50+
'notnull' => false,
51+
'default' => null,
52+
'length' => 64,
53+
]);
54+
$schemaChanged = true;
55+
}
5156
}
5257

53-
return null;
58+
return $schemaChanged ? $schema : null;
5459
}
5560
}

0 commit comments

Comments
 (0)