diff options
author | Marcel Klehr <mklehr@gmx.net> | 2022-07-29 14:43:26 +0200 |
---|---|---|
committer | Marcel Klehr <mklehr@gmx.net> | 2022-08-01 14:27:34 +0200 |
commit | 047cc708d45f5dee07e986a1d6cf538049edd36c (patch) | |
tree | c6fa0659fb4897ca86892e8636598a57201add9d /core/Command | |
parent | 52dc51cde3aafc49e2933e6b72964ad43ee3a335 (diff) | |
download | nextcloud-server-047cc708d45f5dee07e986a1d6cf538049edd36c.tar.gz nextcloud-server-047cc708d45f5dee07e986a1d6cf538049edd36c.zip |
DB mounts table: Add index for mount_provider_class
Signed-off-by: Marcel Klehr <mklehr@gmx.net>
Diffstat (limited to 'core/Command')
-rw-r--r-- | core/Command/Db/AddMissingIndices.php | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/core/Command/Db/AddMissingIndices.php b/core/Command/Db/AddMissingIndices.php index 957c5251454..5799a462ffa 100644 --- a/core/Command/Db/AddMissingIndices.php +++ b/core/Command/Db/AddMissingIndices.php @@ -444,6 +444,19 @@ class AddMissingIndices extends Command { } } + $output->writeln('<info>Check indices of the oc_mounts table.</info>'); + if ($schema->hasTable('mounts')) { + $table = $schema->getTable('mounts'); + if (!$table->hasIndex('mounts_class_index')) { + $output->writeln('<info>Adding mounts_class_index index to the oc_mounts table, this can take some time...</info>'); + + $table->addIndex(['mount_provider_class'], 'mounts_class_index'); + $this->connection->migrateToSchema($schema->getWrappedSchema()); + $updated = true; + $output->writeln('<info>oc_mounts table updated successfully.</info>'); + } + } + if (!$updated) { $output->writeln('<info>Done.</info>'); } |