Skip to content

Commit 2d2c9ec

Browse files
authored
Merge pull request #9724 from nextcloud/feature/9327/parent_share_index
Add parent index to share table
2 parents 2794d62 + 2f59f38 commit 2d2c9ec

2 files changed

Lines changed: 10 additions & 1 deletion

File tree

core/Command/Db/AddMissingIndices.php

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,12 +84,20 @@ private function addShareTableIndicies(OutputInterface $output) {
8484
if ($schema->hasTable('share')) {
8585
$table = $schema->getTable('share');
8686
if (!$table->hasIndex('share_with_index')) {
87-
$output->writeln('<info>Adding additional index to the share table, this can take some time...</info>');
87+
$output->writeln('<info>Adding additional share_with index to the share table, this can take some time...</info>');
8888
$table->addIndex(['share_with'], 'share_with_index');
8989
$this->connection->migrateToSchema($schema->getWrappedSchema());
9090
$updated = true;
9191
$output->writeln('<info>Share table updated successfully.</info>');
9292
}
93+
94+
if (!$table->hasIndex('parent_index')) {
95+
$output->writeln('<info>Adding additional parent index to the share table, this can take some time...</info>');
96+
$table->addIndex(['parent'], 'parent_index');
97+
$this->connection->migrateToSchema($schema->getWrappedSchema());
98+
$updated = true;
99+
$output->writeln('<info>Share table updated successfully.</info>');
100+
}
93101
}
94102

95103
if (!$updated) {

core/Migrations/Version13000Date20170718121200.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -401,6 +401,7 @@ public function changeSchema(IOutput $output, \Closure $schemaClosure, array $op
401401
$table->addIndex(['file_source'], 'file_source_index');
402402
$table->addIndex(['token'], 'token_index');
403403
$table->addIndex(['share_with'], 'share_with_index');
404+
$table->addIndex(['parent'], 'parent_index');
404405
}
405406

406407
if (!$schema->hasTable('jobs')) {

0 commit comments

Comments
 (0)