Browse Source
Add index for direct editing cleanup job
Signed-off-by: Julius Härtl <jus@bitgrid.net>
pull/31042/head
Julius Härtl
4 years ago
No known key found for this signature in database
GPG Key ID: 4C614C6ED2CDE6DF
3 changed files with
21 additions and
0 deletions
-
core/Application.php
-
core/Command/Db/AddMissingIndices.php
-
core/Migrations/Version18000Date20191014105105.php
|
|
|
@ -206,6 +206,13 @@ class Application extends App { |
|
|
|
$subject->addHintForMissingSubject($table->getName(), 'job_lastcheck_reserved'); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
if ($schema->hasTable('direct_edit')) { |
|
|
|
$table = $schema->getTable('direct_edit'); |
|
|
|
if (!$table->hasIndex('direct_edit_timestamp')) { |
|
|
|
$subject->addHintForMissingSubject($table->getName(), 'direct_edit_timestamp'); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
); |
|
|
|
|
|
|
|
|
|
|
|
@ -352,6 +352,19 @@ class AddMissingIndices extends Command { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
$output->writeln('<info>Check indices of the oc_direct_edit table.</info>'); |
|
|
|
if ($schema->hasTable('direct_edit')) { |
|
|
|
$table = $schema->getTable('direct_edit'); |
|
|
|
if (!$table->hasIndex('direct_edit_timestamp')) { |
|
|
|
$output->writeln('<info>Adding direct_edit_timestamp index to the oc_direct_edit table, this can take some time...</info>'); |
|
|
|
|
|
|
|
$table->addIndex(['timestamp'], 'direct_edit_timestamp'); |
|
|
|
$this->connection->migrateToSchema($schema->getWrappedSchema()); |
|
|
|
$updated = true; |
|
|
|
$output->writeln('<info>oc_direct_edit table updated successfully.</info>'); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
if (!$updated) { |
|
|
|
$output->writeln('<info>Done.</info>'); |
|
|
|
} |
|
|
|
|
|
|
|
@ -89,6 +89,7 @@ class Version18000Date20191014105105 extends SimpleMigrationStep { |
|
|
|
|
|
|
|
$table->setPrimaryKey(['id']); |
|
|
|
$table->addIndex(['token']); |
|
|
|
$table->addIndex(['timestamp'], 'direct_edit_timestamp'); |
|
|
|
|
|
|
|
return $schema; |
|
|
|
} |
|
|
|
|