Add parent index to share table

Fixes #9327

Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
This commit is contained in:
Roeland Jago Douma 2018-06-03 13:32:49 +02:00
parent d9238b810a
commit 2f59f389d2
No known key found for this signature in database
GPG Key ID: F941078878347C0C
2 changed files with 10 additions and 1 deletions

View File

@ -84,12 +84,20 @@ class AddMissingIndices extends Command {
if ($schema->hasTable('share')) {
$table = $schema->getTable('share');
if (!$table->hasIndex('share_with_index')) {
$output->writeln('<info>Adding additional index to the share table, this can take some time...</info>');
$output->writeln('<info>Adding additional share_with index to the share table, this can take some time...</info>');
$table->addIndex(['share_with'], 'share_with_index');
$this->connection->migrateToSchema($schema->getWrappedSchema());
$updated = true;
$output->writeln('<info>Share table updated successfully.</info>');
}
if (!$table->hasIndex('parent_index')) {
$output->writeln('<info>Adding additional parent index to the share table, this can take some time...</info>');
$table->addIndex(['parent'], 'parent_index');
$this->connection->migrateToSchema($schema->getWrappedSchema());
$updated = true;
$output->writeln('<info>Share table updated successfully.</info>');
}
}
if (!$updated) {

View File

@ -401,6 +401,7 @@ class Version13000Date20170718121200 extends SimpleMigrationStep {
$table->addIndex(['file_source'], 'file_source_index');
$table->addIndex(['token'], 'token_index');
$table->addIndex(['share_with'], 'share_with_index');
$table->addIndex(['parent'], 'parent_index');
}
if (!$schema->hasTable('jobs')) {