mirror of
https://github.com/nextcloud/server.git
synced 2026-06-11 09:42:09 -04:00
fix(settings): show warning for indexToReplace as part of missing indices
Signed-off-by: Johannes Merkel <mail@johannesgge.de>
This commit is contained in:
parent
6101abbb2d
commit
33a0aa6994
1 changed files with 13 additions and 0 deletions
|
|
@ -56,6 +56,7 @@ class DatabaseHasMissingIndices implements ISetupCheck {
|
|||
$event = new AddMissingIndicesEvent();
|
||||
$this->dispatcher->dispatchTyped($event);
|
||||
$missingIndices = $event->getMissingIndices();
|
||||
$indicesToReplace = $event->getIndicesToReplace();
|
||||
|
||||
if (!empty($missingIndices)) {
|
||||
$schema = new SchemaWrapper($this->connection);
|
||||
|
|
@ -69,6 +70,18 @@ class DatabaseHasMissingIndices implements ISetupCheck {
|
|||
}
|
||||
}
|
||||
|
||||
if (!empty($indicesToReplace)) {
|
||||
$schema = new SchemaWrapper($this->connection);
|
||||
foreach ($indicesToReplace as $indexToReplace) {
|
||||
if ($schema->hasTable($indexToReplace['tableName'])) {
|
||||
$table = $schema->getTable($indexToReplace['tableName']);
|
||||
if (!$table->hasIndex($indexToReplace['newIndexName'])) {
|
||||
$indexInfo->addHintForMissingIndex($indexToReplace['tableName'], $indexToReplace['newIndexName']);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return $indexInfo->getListOfMissingIndices();
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue