summaryrefslogtreecommitdiffstats
path: root/core/Command
diff options
context:
space:
mode:
authorMario Danic <mario@lovelyhq.com>2020-04-30 00:13:13 +0200
committerMario Danic <mario@lovelyhq.com>2020-04-30 23:04:15 +0200
commit6e28c2807b751a9dbd2a60abb3038eed3cf04b42 (patch)
treed3e558553bb509aefad4210280ce91f015f28c41 /core/Command
parent8d5404b750df85a947c43aacc266c6088d8b4aed (diff)
downloadnextcloud-server-6e28c2807b751a9dbd2a60abb3038eed3cf04b42.tar.gz
nextcloud-server-6e28c2807b751a9dbd2a60abb3038eed3cf04b42.zip
Add index to properties table
Signed-off-by: Mario Danic <mario@lovelyhq.com>
Diffstat (limited to 'core/Command')
-rw-r--r--core/Command/Db/AddMissingIndices.php14
1 files changed, 14 insertions, 0 deletions
diff --git a/core/Command/Db/AddMissingIndices.php b/core/Command/Db/AddMissingIndices.php
index 506fef94a63..2784721f55f 100644
--- a/core/Command/Db/AddMissingIndices.php
+++ b/core/Command/Db/AddMissingIndices.php
@@ -11,6 +11,7 @@ declare(strict_types=1);
* @author Robin Appelman <robin@icewind.nl>
* @author Roeland Jago Douma <roeland@famdouma.nl>
* @author Thomas Citharel <nextcloud@tcit.fr>
+ * @author Mario Danic <mario@lovelyhq.com>
*
* @license GNU AGPL version 3 or any later version
*
@@ -254,6 +255,19 @@ class AddMissingIndices extends Command {
}
}
+ $output->writeln('<info>Check indices of the oc_properties table.</info>');
+ if ($schema->hasTable('properties')) {
+ $table = $schema->getTable('properties');
+ 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());
+ $updated = true;
+ $output->writeln('<info>oc_properties table updated successfully.</info>');
+ }
+ }
+
if (!$updated) {
$output->writeln('<info>Done.</info>');
}