From 529702107a955f8c4f05ede59a39c2d464e3dc32 Mon Sep 17 00:00:00 2001 From: Marcel Klehr Date: Wed, 21 Jun 2023 15:10:06 +0200 Subject: fix(systemtags): Add missing systemtags index Signed-off-by: Marcel Klehr --- core/Command/Db/AddMissingIndices.php | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'core/Command') 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('Check indices of the oc_systemtag_object_mapping table.'); + if ($schema->hasTable('oc_systemtag_object_mapping')) { + $table = $schema->getTable('oc_systemtag_object_mapping'); + if (!$table->hasIndex('systag_by_tagid')) { + $output->writeln('Adding systag_by_tagid index to the oc_systemtag_object_mapping table, this can take some time...'); + + $table->addIndex(['systemtagid', 'objecttype'], 'systag_by_tagid'); + $this->connection->migrateToSchema($schema->getWrappedSchema()); + $updated = true; + $output->writeln('oc_systemtag_object_mapping table updated successfully.'); + } + } + if (!$updated) { $output->writeln('Done.'); } -- cgit v1.2.3