diff options
author | Robin Appelman <robin@icewind.nl> | 2021-10-19 14:41:23 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-10-19 14:41:23 +0000 |
commit | 5155f2b0c551703616ef8b7deb1a5b939b1c2450 (patch) | |
tree | 071610748e779a1c112a2036b7b19d12b3e666fe /core/Command | |
parent | 1b16a136ebd8f63e09df061d383f34170e2cef35 (diff) | |
parent | 695326534c18749f36e9172e7b7345824213ee60 (diff) | |
download | nextcloud-server-5155f2b0c551703616ef8b7deb1a5b939b1c2450.tar.gz nextcloud-server-5155f2b0c551703616ef8b7deb1a5b939b1c2450.zip |
Merge pull request #28541 from nextcloud/path-prefix-index2
add a prefix index to filecache.path, attempt 2
Diffstat (limited to 'core/Command')
-rw-r--r-- | core/Command/Db/AddMissingIndices.php | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/core/Command/Db/AddMissingIndices.php b/core/Command/Db/AddMissingIndices.php index c4360157f72..348b4f94f0d 100644 --- a/core/Command/Db/AddMissingIndices.php +++ b/core/Command/Db/AddMissingIndices.php @@ -33,6 +33,7 @@ declare(strict_types=1); */ namespace OC\Core\Command\Db; +use Doctrine\DBAL\Platforms\PostgreSQL94Platform; use OC\DB\Connection; use OC\DB\SchemaWrapper; use OCP\IDBConnection; @@ -151,6 +152,13 @@ class AddMissingIndices extends Command { $updated = true; $output->writeln('<info>Filecache table updated successfully.</info>'); } + if (!$table->hasIndex('fs_storage_path_prefix') && !$schema->getDatabasePlatform() instanceof PostgreSQL94Platform) { + $output->writeln('<info>Adding additional path index to the filecache table, this can take some time...</info>'); + $table->addIndex(['storage', 'path'], 'fs_storage_path_prefix', [], ['lengths' => [null, 64]]); + $this->connection->migrateToSchema($schema->getWrappedSchema()); + $updated = true; + $output->writeln('<info>Filecache table updated successfully.</info>'); + } } $output->writeln('<info>Check indices of the twofactor_providers table.</info>'); |