Add filecache index on mtime
Gives searching by mtime and "recent" a proper index to use Signed-off-by: Robin Appelman <robin@icewind.nl>
This commit is contained in:
parent
596655fa1a
commit
91d3e48ab3
|
@ -71,6 +71,14 @@ class Application extends App {
|
|||
$subject->addHintForMissingSubject($table->getName(), 'parent_index');
|
||||
}
|
||||
}
|
||||
|
||||
if ($schema->hasTable('filecache')) {
|
||||
$table = $schema->getTable('filecache');
|
||||
|
||||
if (!$table->hasIndex('fs_mtime')) {
|
||||
$subject->addHintForMissingSubject($table->getName(), 'fs_mtime');
|
||||
}
|
||||
}
|
||||
}
|
||||
);
|
||||
}
|
||||
|
|
|
@ -100,6 +100,17 @@ class AddMissingIndices extends Command {
|
|||
}
|
||||
}
|
||||
|
||||
if ($schema->hasTable('filecache')) {
|
||||
$table = $schema->getTable('filecache');
|
||||
if (!$table->hasIndex('fs_mtime')) {
|
||||
$output->writeln('<info>Adding additional mtime index to the filecache table, this can take some time...</info>');
|
||||
$table->addIndex(['mtime'], 'fs_mtime');
|
||||
$this->connection->migrateToSchema($schema->getWrappedSchema());
|
||||
$updated = true;
|
||||
$output->writeln('<info>Filecache table updated successfully.</info>');
|
||||
}
|
||||
}
|
||||
|
||||
if (!$updated) {
|
||||
$output->writeln('<info>Done.</info>');
|
||||
}
|
||||
|
|
|
@ -215,6 +215,7 @@ class Version13000Date20170718121200 extends SimpleMigrationStep {
|
|||
$table->addIndex(['storage', 'mimetype'], 'fs_storage_mimetype');
|
||||
$table->addIndex(['storage', 'mimepart'], 'fs_storage_mimepart');
|
||||
$table->addIndex(['storage', 'size', 'fileid'], 'fs_storage_size');
|
||||
$table->addIndex(['mtime'], 'fs_mtime');
|
||||
}
|
||||
|
||||
if (!$schema->hasTable('group_user')) {
|
||||
|
|
Loading…
Reference in New Issue