summaryrefslogtreecommitdiffstats
path: root/core/Command
diff options
context:
space:
mode:
authorMarcel Klehr <mklehr@gmx.net>2023-06-21 15:10:06 +0200
committerArthur Schiwon <blizzz@arthur-schiwon.de>2023-07-10 18:41:42 +0200
commita1ced608e42c321c0ee2eaccf3cdc32ea413541e (patch)
tree8f2944fd8031ccf5c3b4c679eb4c8bfa69a4e428 /core/Command
parent66506502fe1df998637174a3986214c0d9c91056 (diff)
downloadnextcloud-server-a1ced608e42c321c0ee2eaccf3cdc32ea413541e.tar.gz
nextcloud-server-a1ced608e42c321c0ee2eaccf3cdc32ea413541e.zip
fix(systemtags): Add missing systemtags index
Signed-off-by: Marcel Klehr <mklehr@gmx.net>
Diffstat (limited to 'core/Command')
-rw-r--r--core/Command/Db/AddMissingIndices.php13
1 files changed, 13 insertions, 0 deletions
diff --git a/core/Command/Db/AddMissingIndices.php b/core/Command/Db/AddMissingIndices.php
index b317f44b499..452bcbad5dc 100644
--- a/core/Command/Db/AddMissingIndices.php
+++ b/core/Command/Db/AddMissingIndices.php
@@ -475,6 +475,19 @@ class AddMissingIndices extends Command {
}
}
+ $output->writeln('<info>Check indices of the oc_systemtag_object_mapping table.</info>');
+ if ($schema->hasTable('oc_systemtag_object_mapping')) {
+ $table = $schema->getTable('oc_systemtag_object_mapping');
+ if (!$table->hasIndex('systag_by_tagid')) {
+ $output->writeln('<info>Adding systag_by_tagid index to the oc_systemtag_object_mapping table, this can take some time...</info>');
+
+ $table->addIndex(['systemtagid', 'objecttype'], 'systag_by_tagid');
+ $this->connection->migrateToSchema($schema->getWrappedSchema());
+ $updated = true;
+ $output->writeln('<info>oc_systemtag_object_mapping table updated successfully.</info>');
+ }
+ }
+
if (!$updated) {
$output->writeln('<info>Done.</info>');
}