From db43d903877a8b90b78cafb404b1e7101bfb2c15 Mon Sep 17 00:00:00 2001 From: Robin Appelman Date: Thu, 13 Apr 2023 17:19:26 +0200 Subject: add new index in repair step instead of on-migrate Signed-off-by: Robin Appelman --- core/Command/Db/AddMissingIndices.php | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'core/Command') diff --git a/core/Command/Db/AddMissingIndices.php b/core/Command/Db/AddMissingIndices.php index e22d0fddeca..b317f44b499 100644 --- a/core/Command/Db/AddMissingIndices.php +++ b/core/Command/Db/AddMissingIndices.php @@ -465,6 +465,14 @@ class AddMissingIndices extends Command { $updated = true; $output->writeln('oc_mounts table updated successfully.'); } + if (!$table->hasIndex('mounts_user_root_path_index')) { + $output->writeln('Adding mounts_user_root_path_index index to the oc_mounts table, this can take some time...'); + + $table->addIndex(['user_id', 'root_id', 'mount_point'], 'mounts_user_root_path_index', [], ['lengths' => [null, null, 128]]); + $this->connection->migrateToSchema($schema->getWrappedSchema()); + $updated = true; + $output->writeln('oc_mounts table updated successfully.'); + } } if (!$updated) { -- cgit v1.2.3