diff --git a/core/Application.php b/core/Application.php index 7949cfd6638..659a2c5d3d9 100644 --- a/core/Application.php +++ b/core/Application.php @@ -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'); + } + } } ); diff --git a/core/Command/Db/AddMissingIndices.php b/core/Command/Db/AddMissingIndices.php index 0bb6658e85e..02c89992105 100644 --- a/core/Command/Db/AddMissingIndices.php +++ b/core/Command/Db/AddMissingIndices.php @@ -221,6 +221,19 @@ class AddMissingIndices extends Command { } } + $output->writeln('Check indices of the calendarobjects_props table.'); + if ($schema->hasTable('calendarobjects_props')) { + $table = $schema->getTable('calendarobjects_props'); + if (!$table->hasIndex('calendarobject_calid_index')) { + $output->writeln('Adding calendarobject_calid_index index to the calendarobjects_props table, this can take some time...'); + + $table->addIndex(['calendarid', 'calendartype'], 'calendarobject_calid_index'); + $this->connection->migrateToSchema($schema->getWrappedSchema()); + $updated = true; + $output->writeln('calendarobjects_props table updated successfully.'); + } + } + if (!$updated) { $output->writeln('Done.'); }