summaryrefslogtreecommitdiffstats
path: root/core/Command
diff options
context:
space:
mode:
authorChristoph Wurst <christoph@winzerhof-wurst.at>2021-12-23 11:34:51 +0100
committerbackportbot[bot] <backportbot[bot]@users.noreply.github.com>2021-12-29 09:16:28 +0000
commit3cf98b75e2802149c39c66bff455c7bd8246fcd2 (patch)
treeeb412fe97cf07202c30650ae9cfee19b3060d16d /core/Command
parent394915d2e47d231cfd9ba956da35c9770a057749 (diff)
downloadnextcloud-server-3cf98b75e2802149c39c66bff455c7bd8246fcd2.tar.gz
nextcloud-server-3cf98b75e2802149c39c66bff455c7bd8246fcd2.zip
Add missing index for propertypath only queries against properties
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
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 57fa49149f6..4c86a8705db 100644
--- a/core/Command/Db/AddMissingIndices.php
+++ b/core/Command/Db/AddMissingIndices.php
@@ -316,11 +316,24 @@ class AddMissingIndices extends Command {
$output->writeln('<info>Check indices of the oc_properties table.</info>');
if ($schema->hasTable('properties')) {
$table = $schema->getTable('properties');
+ $propertiesUpdated = false;
+
if (!$table->hasIndex('properties_path_index')) {
$output->writeln('<info>Adding properties_path_index index to the oc_properties table, this can take some time...</info>');
$table->addIndex(['userid', 'propertypath'], 'properties_path_index');
$this->connection->migrateToSchema($schema->getWrappedSchema());
+ $propertiesUpdated = true;
+ }
+ if (!$table->hasIndex('properties_pathonly_index')) {
+ $output->writeln('<info>Adding properties_pathonly_index index to the oc_properties table, this can take some time...</info>');
+
+ $table->addIndex(['propertypath'], 'properties_pathonly_index');
+ $this->connection->migrateToSchema($schema->getWrappedSchema());
+ $propertiesUpdated = true;
+ }
+
+ if ($propertiesUpdated) {
$updated = true;
$output->writeln('<info>oc_properties table updated successfully.</info>');
}