diff options
author | Julius Härtl <jus@bitgrid.net> | 2022-02-07 09:25:27 +0100 |
---|---|---|
committer | Julius Härtl <jus@bitgrid.net> | 2022-02-07 09:25:27 +0100 |
commit | 415294e34591b48c598bf38da33a5ad7b40acf7c (patch) | |
tree | 31eb98ea615beb134ce5079d069e08e00c8c09c8 /core/Command/Db | |
parent | 26df2c596b4851624afa1ef7534a3a1fbb89dfcf (diff) | |
download | nextcloud-server-415294e34591b48c598bf38da33a5ad7b40acf7c.tar.gz nextcloud-server-415294e34591b48c598bf38da33a5ad7b40acf7c.zip |
Add index for direct editing cleanup job
Signed-off-by: Julius Härtl <jus@bitgrid.net>
Diffstat (limited to 'core/Command/Db')
-rw-r--r-- | core/Command/Db/AddMissingIndices.php | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/core/Command/Db/AddMissingIndices.php b/core/Command/Db/AddMissingIndices.php index 4c86a8705db..489e44f4011 100644 --- a/core/Command/Db/AddMissingIndices.php +++ b/core/Command/Db/AddMissingIndices.php @@ -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>'); } |