diff options
author | Roeland Jago Douma <rullzer@users.noreply.github.com> | 2018-10-02 17:16:07 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-10-02 17:16:07 +0200 |
commit | ac8d4b2f317899ac7d6748c6374d94150ed6c258 (patch) | |
tree | 803cb66c98fa93f49859590ad33fc7c6654319a9 /core | |
parent | 25790ece89eba804dfe68bf4d688bc0a62b0ad6c (diff) | |
parent | b82cbe04df59805e50d3762e6205c777aeff90a9 (diff) | |
download | nextcloud-server-ac8d4b2f317899ac7d6748c6374d94150ed6c258.tar.gz nextcloud-server-ac8d4b2f317899ac7d6748c6374d94150ed6c258.zip |
Merge pull request #11527 from nextcloud/fix/10926/share_indexes
Add uid_owner and uid_initiator share tabe indices
Diffstat (limited to 'core')
-rw-r--r-- | core/Application.php | 6 | ||||
-rw-r--r-- | core/Command/Db/AddMissingIndices.php | 16 | ||||
-rw-r--r-- | core/Migrations/Version13000Date20170718121200.php | 2 |
3 files changed, 24 insertions, 0 deletions
diff --git a/core/Application.php b/core/Application.php index 336538187d7..5a8b6be089e 100644 --- a/core/Application.php +++ b/core/Application.php @@ -70,6 +70,12 @@ class Application extends App { 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 5d78d360b49..c2068b36915 100644 --- a/core/Command/Db/AddMissingIndices.php +++ b/core/Command/Db/AddMissingIndices.php @@ -98,6 +98,22 @@ class AddMissingIndices extends Command { $updated = true; $output->writeln('<info>Share table updated successfully.</info>'); } + + if (!$table->hasIndex('uid_owner')) { + $output->writeln('<info>Adding additional owner index to the share table, this can take some time...</info>'); + $table->addIndex(['uid_owner'], 'owner_index'); + $this->connection->migrateToSchema($schema->getWrappedSchema()); + $updated = true; + $output->writeln('<info>Share table updated successfully.</info>'); + } + + if (!$table->hasIndex('uid_initiator')) { + $output->writeln('<info>Adding additional initiator index to the share table, this can take some time...</info>'); + $table->addIndex(['uid_initiator'], 'initiator_index'); + $this->connection->migrateToSchema($schema->getWrappedSchema()); + $updated = true; + $output->writeln('<info>Share table updated successfully.</info>'); + } } if ($schema->hasTable('filecache')) { diff --git a/core/Migrations/Version13000Date20170718121200.php b/core/Migrations/Version13000Date20170718121200.php index 29687b8683f..0b2c255738c 100644 --- a/core/Migrations/Version13000Date20170718121200.php +++ b/core/Migrations/Version13000Date20170718121200.php @@ -403,6 +403,8 @@ class Version13000Date20170718121200 extends SimpleMigrationStep { $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')) { |