Skip to content

Commit

Permalink
Merge pull request #41230 from nextcloud/indexFix
Browse files Browse the repository at this point in the history
fix: add index on migration only if needed
  • Loading branch information
solracsf authored Nov 2, 2023
2 parents 58c9831 + a075c85 commit 82f23fb
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 82f23fb

Please sign in to comment.