summaryrefslogtreecommitdiffstats
path: root/core/Command/Db/AddMissingIndices.php
diff options
context:
space:
mode:
authorThomas Citharel <tcit@tcit.fr>2019-10-07 14:39:27 +0200
committerThomas Citharel <tcit@tcit.fr>2019-10-08 10:25:56 +0200
commit68cf47e947b06eb22a22c460e0febc796e5609e2 (patch)
treeb42e3961611cb536a6d31afa68456a932b3a3978 /core/Command/Db/AddMissingIndices.php
parentb7803665c1c030378511161dd51c10ac17e6cf6b (diff)
downloadnextcloud-server-68cf47e947b06eb22a22c460e0febc796e5609e2.tar.gz
nextcloud-server-68cf47e947b06eb22a22c460e0febc796e5609e2.zip
Check and add index on principaluri for schedulingobjects table
Signed-off-by: Thomas Citharel <tcit@tcit.fr>
Diffstat (limited to 'core/Command/Db/AddMissingIndices.php')
-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 02c89992105..527a2cd7b19 100644
--- a/core/Command/Db/AddMissingIndices.php
+++ b/core/Command/Db/AddMissingIndices.php
@@ -234,6 +234,19 @@ class AddMissingIndices extends Command {
}
}
+ $output->writeln('<info>Check indices of the schedulingobjects table.</info>');
+ if ($schema->hasTable('schedulingobjects')) {
+ $table = $schema->getTable('schedulingobjects');
+ if (!$table->hasIndex('schedulobj_principuri_index')) {
+ $output->writeln('<info>Adding schedulobj_principuri_index index to the schedulingobjects table, this can take some time...</info>');
+
+ $table->addIndex(['principaluri'], 'schedulobj_principuri_index');
+ $this->connection->migrateToSchema($schema->getWrappedSchema());
+ $updated = true;
+ $output->writeln('<info>schedulingobjects table updated successfully.</info>');
+ }
+ }
+
if (!$updated) {
$output->writeln('<info>Done.</info>');
}