aboutsummaryrefslogtreecommitdiffstats
path: root/apps/settings
diff options
context:
space:
mode:
authorJosh Richards <josh.t.richards@gmail.com>2024-05-11 10:10:27 -0400
committerJosh Richards <josh.t.richards@gmail.com>2024-05-11 10:29:42 -0400
commit229e5444c97f1bfa80075b59bdba1dcb814d0ec4 (patch)
treeab460d23f2aeac6a7eb2114d28e87004471e60a5 /apps/settings
parentf6d4af8b2c5ba2c589c77e3bd73e634329a17b5c (diff)
downloadnextcloud-server-229e5444c97f1bfa80075b59bdba1dcb814d0ec4.tar.gz
nextcloud-server-229e5444c97f1bfa80075b59bdba1dcb814d0ec4.zip
feat(SetupChecks): Refactor DatabaseHasMissingIndices
Signed-off-by: Josh Richards <josh.t.richards@gmail.com>
Diffstat (limited to 'apps/settings')
-rw-r--r--apps/settings/lib/SetupChecks/DatabaseHasMissingIndices.php14
1 files changed, 11 insertions, 3 deletions
diff --git a/apps/settings/lib/SetupChecks/DatabaseHasMissingIndices.php b/apps/settings/lib/SetupChecks/DatabaseHasMissingIndices.php
index bd33f513b56..597a6bafb51 100644
--- a/apps/settings/lib/SetupChecks/DatabaseHasMissingIndices.php
+++ b/apps/settings/lib/SetupChecks/DatabaseHasMissingIndices.php
@@ -31,6 +31,7 @@ use OC\DB\SchemaWrapper;
use OCP\DB\Events\AddMissingIndicesEvent;
use OCP\EventDispatcher\IEventDispatcher;
use OCP\IL10N;
+use OCP\IURLGenerator;
use OCP\SetupCheck\ISetupCheck;
use OCP\SetupCheck\SetupResult;
@@ -39,6 +40,7 @@ class DatabaseHasMissingIndices implements ISetupCheck {
private IL10N $l10n,
private Connection $connection,
private IEventDispatcher $dispatcher,
+ private IURLGenerator $urlGenerator,
) {
}
@@ -90,12 +92,18 @@ class DatabaseHasMissingIndices implements ISetupCheck {
if (empty($missingIndices)) {
return SetupResult::success('None');
} else {
- $list = '';
+ $processed = 0;
+ $list = $this->l10n->t('Missing indices:');
foreach ($missingIndices as $missingIndex) {
- $list .= "\n".$this->l10n->t('Missing optional index "%s" in table "%s".', [$missingIndex['indexName'], $missingIndex['tableName']]);
+ $processed++;
+ $list .= "\n " . $this->l10n->t('"%s" in table "%s"', [$missingIndex['indexName'], $missingIndex['tableName']]);
+ if (count($missingIndices) > $processed) {
+ $list .= ", ";
+ }
}
return SetupResult::warning(
- $this->l10n->t('The database is missing some indexes. Due to the fact that adding indexes on big tables could take some time they were not added automatically. By running "occ db:add-missing-indices" those missing indexes could be added manually while the instance keeps running. Once the indexes are added queries to those tables are usually much faster.').$list
+ $this->l10n->t('Detected some missing optional indices. Occasionally new indices are added (by Nextcloud or installed applications) to improve database performance. Adding indices can sometimes take awhile and temporarily hurt performance so this is not done automatically during upgrades. Once the indices are added, queries to those tables should be faster. Use the command `occ db:add-missing-indices` to add them. ') . $list . '.',
+ $this->urlGenerator->linkToDocs('admin-long-running-migration-steps')
);
}
}