aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--core/Application.php7
-rw-r--r--core/Command/Db/AddMissingIndices.php13
-rw-r--r--core/Migrations/Version13000Date20170718121200.php1
3 files changed, 21 insertions, 0 deletions
diff --git a/core/Application.php b/core/Application.php
index d987f7cfb17..4e36d59baac 100644
--- a/core/Application.php
+++ b/core/Application.php
@@ -196,6 +196,13 @@ class Application extends App {
$subject->addHintForMissingSubject($table->getName(), 'properties_path_index');
}
}
+
+ if ($schema->hasTable('jobs')) {
+ $table = $schema->getTable('jobs');
+ if (!$table->hasIndex('job_lastcheck_reserved')) {
+ $subject->addHintForMissingSubject($table->getName(), 'job_lastcheck_reserved');
+ }
+ }
}
);
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>');
}
diff --git a/core/Migrations/Version13000Date20170718121200.php b/core/Migrations/Version13000Date20170718121200.php
index 4fa8fb3d1e9..3d97ee1de39 100644
--- a/core/Migrations/Version13000Date20170718121200.php
+++ b/core/Migrations/Version13000Date20170718121200.php
@@ -525,6 +525,7 @@ class Version13000Date20170718121200 extends SimpleMigrationStep {
]);
$table->setPrimaryKey(['id']);
$table->addIndex(['class'], 'job_class_index');
+ $table->addIndex(['last_checked', 'reserved_at'], 'job_lastcheck_reserved');
}
if (!$schema->hasTable('users')) {