summaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorThomas Citharel <tcit@tcit.fr>2019-10-06 15:04:27 +0200
committerThomas Citharel <tcit@tcit.fr>2019-10-07 22:03:15 +0200
commit90e5850cc48abd026228233d11930a82fcf18220 (patch)
treedf3d83fb368913cf4b15de0a1ba1a161d618c34f /core
parent1843ff60fd65b3ea8496ad991d8e905d76222cdf (diff)
downloadnextcloud-server-90e5850cc48abd026228233d11930a82fcf18220.tar.gz
nextcloud-server-90e5850cc48abd026228233d11930a82fcf18220.zip
Add index on calendarid for calendarobject_props table
Signed-off-by: Thomas Citharel <tcit@tcit.fr>
Diffstat (limited to 'core')
-rw-r--r--core/Application.php8
-rw-r--r--core/Command/Db/AddMissingIndices.php13
2 files changed, 21 insertions, 0 deletions
diff --git a/core/Application.php b/core/Application.php
index 7949cfd6638..659a2c5d3d9 100644
--- a/core/Application.php
+++ b/core/Application.php
@@ -145,6 +145,14 @@ class Application extends App {
$subject->addHintForMissingSubject($table->getName(), 'cards_prop_abid');
}
}
+
+ if ($schema->hasTable('calendarobjects_props')) {
+ $table = $schema->getTable('calendarobjects_props');
+
+ if (!$table->hasIndex('calendarobject_calid_index')) {
+ $subject->addHintForMissingSubject($table->getName(), 'calendarobject_calid_index');
+ }
+ }
}
);
diff --git a/core/Command/Db/AddMissingIndices.php b/core/Command/Db/AddMissingIndices.php
index 0bb6658e85e..02c89992105 100644
--- a/core/Command/Db/AddMissingIndices.php
+++ b/core/Command/Db/AddMissingIndices.php
@@ -221,6 +221,19 @@ class AddMissingIndices extends Command {
}
}
+ $output->writeln('<info>Check indices of the calendarobjects_props table.</info>');
+ if ($schema->hasTable('calendarobjects_props')) {
+ $table = $schema->getTable('calendarobjects_props');
+ if (!$table->hasIndex('calendarobject_calid_index')) {
+ $output->writeln('<info>Adding calendarobject_calid_index index to the calendarobjects_props table, this can take some time...</info>');
+
+ $table->addIndex(['calendarid', 'calendartype'], 'calendarobject_calid_index');
+ $this->connection->migrateToSchema($schema->getWrappedSchema());
+ $updated = true;
+ $output->writeln('<info>calendarobjects_props table updated successfully.</info>');
+ }
+ }
+
if (!$updated) {
$output->writeln('<info>Done.</info>');
}