summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGit'Fellow <12234510+solracsf@users.noreply.github.com>2023-11-01 17:12:45 +0100
committerbackportbot-nextcloud[bot] <backportbot-nextcloud[bot]@users.noreply.github.com>2023-11-02 01:10:35 +0000
commitad6ccdbd217d4ba44a9da3ffc9298bc68dc02803 (patch)
treedbf9862c0a9b6b74f641db91bfea6a846adefa98
parentd4e423fe0bd5a99676540fe9820dcd9d88f98315 (diff)
downloadnextcloud-server-ad6ccdbd217d4ba44a9da3ffc9298bc68dc02803.tar.gz
nextcloud-server-ad6ccdbd217d4ba44a9da3ffc9298bc68dc02803.zip
fix: add index on migration only if needed
Signed-off-by: Git'Fellow <12234510+solracsf@users.noreply.github.com>
-rw-r--r--core/Migrations/Version28000Date20230803221055.php4
1 files changed, 3 insertions, 1 deletions
diff --git a/core/Migrations/Version28000Date20230803221055.php b/core/Migrations/Version28000Date20230803221055.php
index 8878a6f6cce..3aaf4f19431 100644
--- a/core/Migrations/Version28000Date20230803221055.php
+++ b/core/Migrations/Version28000Date20230803221055.php
@@ -52,7 +52,9 @@ class Version28000Date20230803221055 extends SimpleMigrationStep {
$column = $table->getColumn('user_id');
$column->setNotnull(false);
- $table->addIndex(['user_id', 'app_id', 'identifier'], 'tp_tasks_uid_appid_ident');
+ if (!$table->hasIndex('tp_tasks_uid_appid_ident')) {
+ $table->addIndex(['user_id', 'app_id', 'identifier'], 'tp_tasks_uid_appid_ident');
+ }
$changed = true;
}