mirror of
https://github.com/nextcloud/server.git
synced 2026-05-25 02:34:12 -04:00
Merge pull request #48480 from nextcloud/checkColExists
fix(migration): Check if column exits before adding it
This commit is contained in:
commit
b30ef38be1
1 changed files with 21 additions and 15 deletions
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue