Skip to content

Commit b82cbe0

Browse files
committed
Add uid_owner and uid_initiator share tabe indices
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
1 parent 28eaacd commit b82cbe0

File tree

3 files changed

+24
-0
lines changed

3 files changed

+24
-0
lines changed

core/Application.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,12 @@ function(GenericEvent $event) use ($container) {
7070
if (!$table->hasIndex('parent_index')) {
7171
$subject->addHintForMissingSubject($table->getName(), 'parent_index');
7272
}
73+
if (!$table->hasIndex('uid_owner')) {
74+
$subject->addHintForMissingSubject($table->getName(), 'uid_owner');
75+
}
76+
if (!$table->hasIndex('uid_initiator')) {
77+
$subject->addHintForMissingSubject($table->getName(), 'uid_initiator');
78+
}
7379
}
7480

7581
if ($schema->hasTable('filecache')) {

core/Command/Db/AddMissingIndices.php

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,22 @@ private function addShareTableIndicies(OutputInterface $output) {
9898
$updated = true;
9999
$output->writeln('<info>Share table updated successfully.</info>');
100100
}
101+
102+
if (!$table->hasIndex('uid_owner')) {
103+
$output->writeln('<info>Adding additional owner index to the share table, this can take some time...</info>');
104+
$table->addIndex(['uid_owner'], 'owner_index');
105+
$this->connection->migrateToSchema($schema->getWrappedSchema());
106+
$updated = true;
107+
$output->writeln('<info>Share table updated successfully.</info>');
108+
}
109+
110+
if (!$table->hasIndex('uid_initiator')) {
111+
$output->writeln('<info>Adding additional initiator index to the share table, this can take some time...</info>');
112+
$table->addIndex(['uid_initiator'], 'initiator_index');
113+
$this->connection->migrateToSchema($schema->getWrappedSchema());
114+
$updated = true;
115+
$output->writeln('<info>Share table updated successfully.</info>');
116+
}
101117
}
102118

103119
if ($schema->hasTable('filecache')) {

core/Migrations/Version13000Date20170718121200.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -403,6 +403,8 @@ public function changeSchema(IOutput $output, \Closure $schemaClosure, array $op
403403
$table->addIndex(['token'], 'token_index');
404404
$table->addIndex(['share_with'], 'share_with_index');
405405
$table->addIndex(['parent'], 'parent_index');
406+
$table->addIndex(['uid_owner'], 'owner_index');
407+
$table->addIndex(['uid_initiator'], 'initiator_index');
406408
}
407409

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

0 commit comments

Comments
 (0)