Skip to content

Commit 32bbce6

Browse files
committed
Add parent index on filecache
Signed-off-by: Louis Chemineau <[email protected]>
1 parent c2cc3af commit 32bbce6

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

core/Command/Db/AddMissingIndices.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -182,6 +182,16 @@ private function addCoreIndexes(OutputInterface $output, bool $dryRun): void {
182182
$updated = true;
183183
$output->writeln('<info>Filecache table updated successfully.</info>');
184184
}
185+
if (!$table->hasIndex('fs_parent') && !$schema->getDatabasePlatform() instanceof PostgreSQL94Platform) {
186+
$output->writeln('<info>Adding additional parent index to the filecache table, this can take some time...</info>');
187+
$table->addIndex(['parent'], 'fs_parent', [], ['lengths' => [null, 64]]);
188+
$sqlQueries = $this->connection->migrateToSchema($schema->getWrappedSchema(), $dryRun);
189+
if ($dryRun && $sqlQueries !== null) {
190+
$output->writeln($sqlQueries);
191+
}
192+
$updated = true;
193+
$output->writeln('<info>Filecache table updated successfully.</info>');
194+
}
185195
}
186196

187197
$output->writeln('<info>Check indices of the twofactor_providers table.</info>');

0 commit comments

Comments
 (0)