Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarcel Klehr <mklehr@gmx.net>2022-07-29 15:43:26 +0300
committerMarcel Klehr <mklehr@gmx.net>2022-10-27 12:56:37 +0300
commit67af99e14e548a0805a6cd8dff8b2edef777b94c (patch)
treeae327af5a2c7934291266fa6771d133ce6d38013
parentd48f13a3c63b97d4bcfa10322afd8fec92662dac (diff)
DB mounts table: Add index for mount_provider_class
Signed-off-by: Marcel Klehr <mklehr@gmx.net>
-rw-r--r--core/Application.php7
-rw-r--r--core/Command/Db/AddMissingIndices.php16
-rw-r--r--core/Migrations/Version24000Date20220202150027.php1
3 files changed, 24 insertions, 0 deletions
diff --git a/core/Application.php b/core/Application.php
index 34932cab183..8775b9cf88b 100644
--- a/core/Application.php
+++ b/core/Application.php
@@ -218,6 +218,13 @@ class Application extends App {
$subject->addHintForMissingSubject($table->getName(), 'direct_edit_timestamp');
}
}
+
+ if ($schema->hasTable('mounts')) {
+ $table = $schema->getTable('mounts');
+ if (!$table->hasIndex('mounts_class_index')) {
+ $subject->addHintForMissingSubject($table->getName(), 'mounts_class_index');
+ }
+ }
}
);
diff --git a/core/Command/Db/AddMissingIndices.php b/core/Command/Db/AddMissingIndices.php
index a4379ffacc3..c31acdb1225 100644
--- a/core/Command/Db/AddMissingIndices.php
+++ b/core/Command/Db/AddMissingIndices.php
@@ -435,6 +435,22 @@ 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');
+ $sqlQueries = $this->connection->migrateToSchema($schema->getWrappedSchema(), $dryRun);
+ if ($dryRun && $sqlQueries !== null) {
+ $output->writeln($sqlQueries);
+ }
+ $updated = true;
+ $output->writeln('<info>oc_mounts table updated successfully.</info>');
+ }
+ }
+
if (!$updated) {
$output->writeln('<info>Done.</info>');
}
diff --git a/core/Migrations/Version24000Date20220202150027.php b/core/Migrations/Version24000Date20220202150027.php
index 76a3ae8c73c..6a3f5ad2faf 100644
--- a/core/Migrations/Version24000Date20220202150027.php
+++ b/core/Migrations/Version24000Date20220202150027.php
@@ -30,6 +30,7 @@ class Version24000Date20220202150027 extends SimpleMigrationStep {
'notnull' => false,
'length' => 128,
]);
+ $table->addIndex(['mount_provider_class'], 'mounts_class_index');
return $schema;
}
return null;