summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRoeland Jago Douma <rullzer@users.noreply.github.com>2019-10-08 19:26:32 +0200
committerGitHub <noreply@github.com>2019-10-08 19:26:32 +0200
commitc0827cfb1df9310c8f11ab27c2c98a0f6e0f189e (patch)
tree15ef547bd214a001157c9c030f86ea3110f8bd97
parent480a3fc7afb622fe1954a6053ebedaada8bf5053 (diff)
parent68cf47e947b06eb22a22c460e0febc796e5609e2 (diff)
downloadnextcloud-server-c0827cfb1df9310c8f11ab27c2c98a0f6e0f189e.tar.gz
nextcloud-server-c0827cfb1df9310c8f11ab27c2c98a0f6e0f189e.zip
Merge pull request #17445 from nextcloud/db/add-index-on-schedulingobjects
Add index on principaluri for schedulingobjects table
-rw-r--r--core/Application.php7
-rw-r--r--core/Command/Db/AddMissingIndices.php13
2 files changed, 20 insertions, 0 deletions
diff --git a/core/Application.php b/core/Application.php
index 659a2c5d3d9..cc4d9ba990b 100644
--- a/core/Application.php
+++ b/core/Application.php
@@ -153,6 +153,13 @@ class Application extends App {
$subject->addHintForMissingSubject($table->getName(), 'calendarobject_calid_index');
}
}
+
+ if ($schema->hasTable('schedulingobjects')) {
+ $table = $schema->getTable('schedulingobjects');
+ if (!$table->hasIndex('schedulobj_principuri_index')) {
+ $subject->addHintForMissingSubject($table->getName(), 'schedulobj_principuri_index');
+ }
+ }
}
);
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>');
}