mirror of
https://github.com/nextcloud/server.git
synced 2026-06-10 17:23:59 -04:00
Merge pull request #41232 from nextcloud/backport/41230/stable27
[stable27] fix: add index on migration only if needed
This commit is contained in:
commit
34acba0ae7
1 changed files with 4 additions and 3 deletions
|
|
@ -52,9 +52,10 @@ class Version28000Date20230803221055 extends SimpleMigrationStep {
|
|||
$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) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue