summaryrefslogtreecommitdiffstats
path: root/core/Command
diff options
context:
space:
mode:
authorRoeland Jago Douma <roeland@famdouma.nl>2018-12-21 13:02:25 +0100
committerRoeland Jago Douma <roeland@famdouma.nl>2018-12-21 13:03:02 +0100
commit16cc68a2fed58199486d10253995e09e966a2380 (patch)
tree420b2890296345ce0bdb25cbaaa3ff41d98c2b4a /core/Command
parentc2d75ddc4f48ed7b195680f30d975612aed6337c (diff)
downloadnextcloud-server-16cc68a2fed58199486d10253995e09e966a2380.tar.gz
nextcloud-server-16cc68a2fed58199486d10253995e09e966a2380.zip
Add twofactor_providers_uid index
Fixes #12943 Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
Diffstat (limited to 'core/Command')
-rw-r--r--core/Command/Db/AddMissingIndices.php17
1 files changed, 15 insertions, 2 deletions
diff --git a/core/Command/Db/AddMissingIndices.php b/core/Command/Db/AddMissingIndices.php
index 8fb5f9b4e88..3bc66988529 100644
--- a/core/Command/Db/AddMissingIndices.php
+++ b/core/Command/Db/AddMissingIndices.php
@@ -61,7 +61,7 @@ class AddMissingIndices extends Command {
}
protected function execute(InputInterface $input, OutputInterface $output) {
- $this->addShareTableIndicies($output);
+ $this->addCoreIndexes($output);
// Dispatch event so apps can also update indexes if needed
$event = new GenericEvent($output);
@@ -74,7 +74,7 @@ class AddMissingIndices extends Command {
* @param OutputInterface $output
* @throws \Doctrine\DBAL\Schema\SchemaException
*/
- private function addShareTableIndicies(OutputInterface $output) {
+ private function addCoreIndexes(OutputInterface $output) {
$output->writeln('<info>Check indices of the share table.</info>');
@@ -116,6 +116,7 @@ class AddMissingIndices extends Command {
}
}
+ $output->writeln('<info>Check indices of the filecache table.</info>');
if ($schema->hasTable('filecache')) {
$table = $schema->getTable('filecache');
if (!$table->hasIndex('fs_mtime')) {
@@ -127,6 +128,18 @@ class AddMissingIndices extends Command {
}
}
+ $output->writeln('<info>Check indices of the twofactor_providers table.</info>');
+ if ($schema->hasTable('twofactor_providers')) {
+ $table = $schema->getTable('twofactor_providers');
+ if (!$table->hasIndex('twofactor_providers_uid')) {
+ $output->writeln('<info>Adding additional twofactor_providers_uid index to the twofactor_providers table, this can take some time...</info>');
+ $table->addIndex(['uid'], 'twofactor_providers_uid');
+ $this->connection->migrateToSchema($schema->getWrappedSchema());
+ $updated = true;
+ $output->writeln('<info>Twofactor_providers table updated successfully.</info>');
+ }
+ }
+
if (!$updated) {
$output->writeln('<info>Done.</info>');
}