diff options
author | Marcel Klehr <mklehr@gmx.net> | 2023-06-21 15:10:06 +0200 |
---|---|---|
committer | Marcel Klehr <mklehr@gmx.net> | 2023-06-23 11:43:26 +0200 |
commit | 529702107a955f8c4f05ede59a39c2d464e3dc32 (patch) | |
tree | bc4583216cf52abcf07168ab06c6fa0b76deefff /core/Command | |
parent | 913d9da7b5cd84f717e540294d68988b4a919e0f (diff) | |
download | nextcloud-server-529702107a955f8c4f05ede59a39c2d464e3dc32.tar.gz nextcloud-server-529702107a955f8c4f05ede59a39c2d464e3dc32.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.php | 13 |
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>'); } |