mirror of
https://github.com/nextcloud/server.git
synced 2026-02-18 18:28:50 -05:00
Add index on calendarid for calendarobject_props table
Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
parent
1843ff60fd
commit
90e5850cc4
2 changed files with 21 additions and 0 deletions
|
|
@ -145,6 +145,14 @@ class Application extends App {
|
|||
$subject->addHintForMissingSubject($table->getName(), 'cards_prop_abid');
|
||||
}
|
||||
}
|
||||
|
||||
if ($schema->hasTable('calendarobjects_props')) {
|
||||
$table = $schema->getTable('calendarobjects_props');
|
||||
|
||||
if (!$table->hasIndex('calendarobject_calid_index')) {
|
||||
$subject->addHintForMissingSubject($table->getName(), 'calendarobject_calid_index');
|
||||
}
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
|
|
|
|||
|
|
@ -221,6 +221,19 @@ class AddMissingIndices extends Command {
|
|||
}
|
||||
}
|
||||
|
||||
$output->writeln('<info>Check indices of the calendarobjects_props table.</info>');
|
||||
if ($schema->hasTable('calendarobjects_props')) {
|
||||
$table = $schema->getTable('calendarobjects_props');
|
||||
if (!$table->hasIndex('calendarobject_calid_index')) {
|
||||
$output->writeln('<info>Adding calendarobject_calid_index index to the calendarobjects_props table, this can take some time...</info>');
|
||||
|
||||
$table->addIndex(['calendarid', 'calendartype'], 'calendarobject_calid_index');
|
||||
$this->connection->migrateToSchema($schema->getWrappedSchema());
|
||||
$updated = true;
|
||||
$output->writeln('<info>calendarobjects_props table updated successfully.</info>');
|
||||
}
|
||||
}
|
||||
|
||||
if (!$updated) {
|
||||
$output->writeln('<info>Done.</info>');
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue