aboutsummaryrefslogtreecommitdiffstats
path: root/apps/settings/lib/Controller
diff options
context:
space:
mode:
authorCôme Chilliet <come.chilliet@nextcloud.com>2023-11-14 16:07:37 +0100
committerCôme Chilliet <91878298+come-nc@users.noreply.github.com>2023-11-27 15:23:52 +0100
commit1b547c7db88f872db999793f56554cb9e3a4366b (patch)
treeb362d7b59489764d19e79a35561fd434588e50b7 /apps/settings/lib/Controller
parentad88c04f2de08e2adda5dc2031699d892466fd94 (diff)
downloadnextcloud-server-1b547c7db88f872db999793f56554cb9e3a4366b.tar.gz
nextcloud-server-1b547c7db88f872db999793f56554cb9e3a4366b.zip
Migrate missing primary key 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.php25
1 files changed, 0 insertions, 25 deletions
diff --git a/apps/settings/lib/Controller/CheckSetupController.php b/apps/settings/lib/Controller/CheckSetupController.php
index 27ee0df4971..7bb2c8319c2 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\MissingPrimaryKeyInformation;
use OC\DB\SchemaWrapper;
use OC\IntegrityCheck\Checker;
use OCP\App\IAppManager;
@@ -60,7 +59,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\AddMissingPrimaryKeyEvent;
use OCP\DB\Types;
use OCP\EventDispatcher\IEventDispatcher;
use OCP\Http\Client\IClientService;
@@ -415,28 +413,6 @@ Raw output
return $recommendations;
}
- protected function hasMissingPrimaryKeys(): array {
- $info = new MissingPrimaryKeyInformation();
- // Dispatch event so apps can also hint for pending key updates if needed
- $event = new AddMissingPrimaryKeyEvent();
- $this->dispatcher->dispatchTyped($event);
- $missingKeys = $event->getMissingPrimaryKeys();
-
- if (!empty($missingKeys)) {
- $schema = new SchemaWrapper(\OCP\Server::get(Connection::class));
- foreach ($missingKeys as $missingKey) {
- if ($schema->hasTable($missingKey['tableName'])) {
- $table = $schema->getTable($missingKey['tableName']);
- if (!$table->hasPrimaryKey()) {
- $info->addHintForMissingSubject($missingKey['tableName']);
- }
- }
- }
- }
-
- return $info->getListOfMissingPrimaryKeys();
- }
-
protected function isSqliteUsed() {
return str_contains($this->config->getSystemValue('dbtype'), 'sqlite');
}
@@ -653,7 +629,6 @@ Raw output
'codeIntegrityCheckerDocumentation' => $this->urlGenerator->linkToDocs('admin-code-integrity'),
'OpcacheSetupRecommendations' => $this->getOpcacheSetupRecommendations(),
'isSettimelimitAvailable' => $this->isSettimelimitAvailable(),
- 'missingPrimaryKeys' => $this->hasMissingPrimaryKeys(),
'isSqliteUsed' => $this->isSqliteUsed(),
'databaseConversionDocumentation' => $this->urlGenerator->linkToDocs('admin-db-conversion'),
'appDirsWithDifferentOwner' => $this->getAppDirsWithDifferentOwner(),