summaryrefslogtreecommitdiffstats
path: root/core/Command
diff options
context:
space:
mode:
authorJoas Schilling <coding@schilljs.com>2021-12-01 23:57:40 +0100
committerJoas Schilling <coding@schilljs.com>2021-12-01 23:57:40 +0100
commit536a812de48e15aed16fe32bb7308a49f57d05df (patch)
tree438188f6f2e9d2bdfbe9f8c86c0ed46872ca0cef /core/Command
parent44ecd0d1d5f77e6798c1dd08da8120ba86585758 (diff)
downloadnextcloud-server-536a812de48e15aed16fe32bb7308a49f57d05df.tar.gz
nextcloud-server-536a812de48e15aed16fe32bb7308a49f57d05df.zip
Add an index for selecting the next job
Signed-off-by: Joas Schilling <coding@schilljs.com>
Diffstat (limited to 'core/Command')
-rw-r--r--core/Command/Db/AddMissingIndices.php13
1 files changed, 13 insertions, 0 deletions
diff --git a/core/Command/Db/AddMissingIndices.php b/core/Command/Db/AddMissingIndices.php
index 348b4f94f0d..57fa49149f6 100644
--- a/core/Command/Db/AddMissingIndices.php
+++ b/core/Command/Db/AddMissingIndices.php
@@ -326,6 +326,19 @@ class AddMissingIndices extends Command {
}
}
+ $output->writeln('<info>Check indices of the oc_jobs table.</info>');
+ if ($schema->hasTable('jobs')) {
+ $table = $schema->getTable('jobs');
+ if (!$table->hasIndex('job_lastcheck_reserved')) {
+ $output->writeln('<info>Adding job_lastcheck_reserved index to the oc_jobs table, this can take some time...</info>');
+
+ $table->addIndex(['last_checked', 'reserved_at'], 'job_lastcheck_reserved');
+ $this->connection->migrateToSchema($schema->getWrappedSchema());
+ $updated = true;
+ $output->writeln('<info>oc_properties table updated successfully.</info>');
+ }
+ }
+
if (!$updated) {
$output->writeln('<info>Done.</info>');
}