diff --git a/core/Application.php b/core/Application.php index 336538187d766..5a8b6be089e90 100644 --- a/core/Application.php +++ b/core/Application.php @@ -70,6 +70,12 @@ function(GenericEvent $event) use ($container) { if (!$table->hasIndex('parent_index')) { $subject->addHintForMissingSubject($table->getName(), 'parent_index'); } + if (!$table->hasIndex('uid_owner')) { + $subject->addHintForMissingSubject($table->getName(), 'uid_owner'); + } + if (!$table->hasIndex('uid_initiator')) { + $subject->addHintForMissingSubject($table->getName(), 'uid_initiator'); + } } if ($schema->hasTable('filecache')) { diff --git a/core/Command/Db/AddMissingIndices.php b/core/Command/Db/AddMissingIndices.php index 5d78d360b495b..c2068b36915c5 100644 --- a/core/Command/Db/AddMissingIndices.php +++ b/core/Command/Db/AddMissingIndices.php @@ -98,6 +98,22 @@ private function addShareTableIndicies(OutputInterface $output) { $updated = true; $output->writeln('Share table updated successfully.'); } + + if (!$table->hasIndex('uid_owner')) { + $output->writeln('Adding additional owner index to the share table, this can take some time...'); + $table->addIndex(['uid_owner'], 'owner_index'); + $this->connection->migrateToSchema($schema->getWrappedSchema()); + $updated = true; + $output->writeln('Share table updated successfully.'); + } + + if (!$table->hasIndex('uid_initiator')) { + $output->writeln('Adding additional initiator index to the share table, this can take some time...'); + $table->addIndex(['uid_initiator'], 'initiator_index'); + $this->connection->migrateToSchema($schema->getWrappedSchema()); + $updated = true; + $output->writeln('Share table updated successfully.'); + } } if ($schema->hasTable('filecache')) { diff --git a/core/Migrations/Version13000Date20170718121200.php b/core/Migrations/Version13000Date20170718121200.php index 29687b8683fda..0b2c255738c5b 100644 --- a/core/Migrations/Version13000Date20170718121200.php +++ b/core/Migrations/Version13000Date20170718121200.php @@ -403,6 +403,8 @@ public function changeSchema(IOutput $output, \Closure $schemaClosure, array $op $table->addIndex(['token'], 'token_index'); $table->addIndex(['share_with'], 'share_with_index'); $table->addIndex(['parent'], 'parent_index'); + $table->addIndex(['uid_owner'], 'owner_index'); + $table->addIndex(['uid_initiator'], 'initiator_index'); } if (!$schema->hasTable('jobs')) {