mirror of
https://github.com/nextcloud/server.git
synced 2026-02-26 03:11:28 -05:00
Merge pull request #38928 from nextcloud/fix/missing-systemtags-index
This commit is contained in:
commit
618c3a4817
3 changed files with 21 additions and 0 deletions
|
|
@ -243,6 +243,13 @@ class Application extends App {
|
|||
$subject->addHintForMissingSubject($table->getName(), 'mounts_user_root_path_index');
|
||||
}
|
||||
}
|
||||
|
||||
if ($schema->hasTable('systemtag_object_mapping')) {
|
||||
$table = $schema->getTable('systemtag_object_mapping');
|
||||
if (!$table->hasIndex('systag_by_tagid')) {
|
||||
$subject->addHintForMissingSubject($table->getName(), 'systag_by_tagid');
|
||||
}
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
|
|
|
|||
|
|
@ -472,6 +472,19 @@ class AddMissingIndices extends Command {
|
|||
}
|
||||
}
|
||||
|
||||
$output->writeln('<info>Check indices of the oc_systemtag_object_mapping table.</info>');
|
||||
if ($schema->hasTable('oc_systemtag_object_mapping')) {
|
||||
$table = $schema->getTable('oc_systemtag_object_mapping');
|
||||
if (!$table->hasIndex('systag_by_tagid')) {
|
||||
$output->writeln('<info>Adding systag_by_tagid index to the oc_systemtag_object_mapping table, this can take some time...</info>');
|
||||
|
||||
$table->addIndex(['systemtagid', 'objecttype'], 'systag_by_tagid');
|
||||
$this->connection->migrateToSchema($schema->getWrappedSchema());
|
||||
$updated = true;
|
||||
$output->writeln('<info>oc_systemtag_object_mapping table updated successfully.</info>');
|
||||
}
|
||||
}
|
||||
|
||||
if (!$updated) {
|
||||
$output->writeln('<info>Done.</info>');
|
||||
}
|
||||
|
|
|
|||
|
|
@ -754,6 +754,7 @@ class Version13000Date20170718121200 extends SimpleMigrationStep {
|
|||
]);
|
||||
$table->setPrimaryKey(['objecttype', 'objectid', 'systemtagid'], 'som_pk');
|
||||
// $table->addUniqueIndex(['objecttype', 'objectid', 'systemtagid'], 'mapping');
|
||||
$table->addIndex(['systemtagid', 'objecttype'], 'systag_by_tagid');
|
||||
}
|
||||
|
||||
if (!$schema->hasTable('systemtag_group')) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue