Skip to content

Commit

Permalink
Merge pull request #41232 from nextcloud/backport/41230/stable27
Browse files Browse the repository at this point in the history
[stable27] fix: add index on migration only if needed
  • Loading branch information
solracsf authored Nov 2, 2023
2 parents d4e423f + 659d7e2 commit 34acba0
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions core/Migrations/Version28000Date20230803221055.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,10 @@ public function changeSchema(IOutput $output, Closure $schemaClosure, array $opt
$column = $table->getColumn('user_id');
$column->setNotnull(false);

$table->addIndex(['user_id', 'app_id', 'identifier'], 'tp_tasks_uid_appid_ident');

$changed = true;
if (!$table->hasIndex('tp_tasks_uid_appid_ident')) {
$table->addIndex(['user_id', 'app_id', 'identifier'], 'tp_tasks_uid_appid_ident');
$changed = true;
}
}

if ($changed) {
Expand Down

0 comments on commit 34acba0

Please sign in to comment.