diff options
author | Côme Chilliet <come.chilliet@nextcloud.com> | 2023-11-14 15:51:26 +0100 |
---|---|---|
committer | Côme Chilliet <91878298+come-nc@users.noreply.github.com> | 2023-11-27 15:23:52 +0100 |
commit | ad88c04f2de08e2adda5dc2031699d892466fd94 (patch) | |
tree | 75df26efb51420f3e9120108de678dc0feaa68e2 /apps/settings/lib/Controller | |
parent | 2cb1c0f2dc0a5678de142c2791fde25475eb1632 (diff) | |
download | nextcloud-server-ad88c04f2de08e2adda5dc2031699d892466fd94.tar.gz nextcloud-server-ad88c04f2de08e2adda5dc2031699d892466fd94.zip |
Migrate missing index database check to new API
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
Diffstat (limited to 'apps/settings/lib/Controller')
-rw-r--r-- | apps/settings/lib/Controller/CheckSetupController.php | 26 |
1 files changed, 0 insertions, 26 deletions
diff --git a/apps/settings/lib/Controller/CheckSetupController.php b/apps/settings/lib/Controller/CheckSetupController.php index 1fa6a658878..27ee0df4971 100644 --- a/apps/settings/lib/Controller/CheckSetupController.php +++ b/apps/settings/lib/Controller/CheckSetupController.php @@ -51,7 +51,6 @@ use GuzzleHttp\Exception\ClientException; use OC; use OC\AppFramework\Http; use OC\DB\Connection; -use OC\DB\MissingIndexInformation; use OC\DB\MissingPrimaryKeyInformation; use OC\DB\SchemaWrapper; use OC\IntegrityCheck\Checker; @@ -61,7 +60,6 @@ use OCP\AppFramework\Http\Attribute\IgnoreOpenAPI; use OCP\AppFramework\Http\DataDisplayResponse; use OCP\AppFramework\Http\DataResponse; use OCP\AppFramework\Http\RedirectResponse; -use OCP\DB\Events\AddMissingIndicesEvent; use OCP\DB\Events\AddMissingPrimaryKeyEvent; use OCP\DB\Types; use OCP\EventDispatcher\IEventDispatcher; @@ -417,29 +415,6 @@ Raw output return $recommendations; } - protected function hasMissingIndexes(): array { - $indexInfo = new MissingIndexInformation(); - - // Dispatch event so apps can also hint for pending index updates if needed - $event = new AddMissingIndicesEvent(); - $this->dispatcher->dispatchTyped($event); - $missingIndices = $event->getMissingIndices(); - - if ($missingIndices !== []) { - $schema = new SchemaWrapper(\OCP\Server::get(Connection::class)); - foreach ($missingIndices as $missingIndex) { - if ($schema->hasTable($missingIndex['tableName'])) { - $table = $schema->getTable($missingIndex['tableName']); - if (!$table->hasIndex($missingIndex['indexName'])) { - $indexInfo->addHintForMissingSubject($missingIndex['tableName'], $missingIndex['indexName']); - } - } - } - } - - return $indexInfo->getListOfMissingIndexes(); - } - protected function hasMissingPrimaryKeys(): array { $info = new MissingPrimaryKeyInformation(); // Dispatch event so apps can also hint for pending key updates if needed @@ -679,7 +654,6 @@ Raw output 'OpcacheSetupRecommendations' => $this->getOpcacheSetupRecommendations(), 'isSettimelimitAvailable' => $this->isSettimelimitAvailable(), 'missingPrimaryKeys' => $this->hasMissingPrimaryKeys(), - 'missingIndexes' => $this->hasMissingIndexes(), 'isSqliteUsed' => $this->isSqliteUsed(), 'databaseConversionDocumentation' => $this->urlGenerator->linkToDocs('admin-db-conversion'), 'appDirsWithDifferentOwner' => $this->getAppDirsWithDifferentOwner(), |