зеркало из https://github.com/nextcloud/server.git
add new index in repair step instead of on-migrate
Signed-off-by: Robin Appelman <robin@icewind.nl>
This commit is contained in:
Родитель
f5e2b0b22f
Коммит
db43d90387
|
@ -239,6 +239,9 @@ class Application extends App {
|
|||
if (!$table->hasIndex('mounts_class_index')) {
|
||||
$subject->addHintForMissingSubject($table->getName(), 'mounts_class_index');
|
||||
}
|
||||
if (!$table->hasIndex('mounts_user_root_path_index')) {
|
||||
$subject->addHintForMissingSubject($table->getName(), 'mounts_user_root_path_index');
|
||||
}
|
||||
}
|
||||
}
|
||||
);
|
||||
|
|
|
@ -465,6 +465,14 @@ class AddMissingIndices extends Command {
|
|||
$updated = true;
|
||||
$output->writeln('<info>oc_mounts table updated successfully.</info>');
|
||||
}
|
||||
if (!$table->hasIndex('mounts_user_root_path_index')) {
|
||||
$output->writeln('<info>Adding mounts_user_root_path_index index to the oc_mounts table, this can take some time...</info>');
|
||||
|
||||
$table->addIndex(['user_id', 'root_id', 'mount_point'], 'mounts_user_root_path_index', [], ['lengths' => [null, null, 128]]);
|
||||
$this->connection->migrateToSchema($schema->getWrappedSchema());
|
||||
$updated = true;
|
||||
$output->writeln('<info>oc_mounts table updated successfully.</info>');
|
||||
}
|
||||
}
|
||||
|
||||
if (!$updated) {
|
||||
|
|
|
@ -43,7 +43,7 @@ class Version27000Date20220613163520 extends SimpleMigrationStep {
|
|||
$table = $schema->getTable('mounts');
|
||||
if ($table->hasIndex('mounts_user_root_index')) {
|
||||
$table->dropIndex('mounts_user_root_index');
|
||||
$table->addIndex(['user_id', 'root_id', 'mount_point'], 'mounts_user_root_path_index', [], ['lengths' => [null, null, 128]]);
|
||||
// new index gets added with "add missing indexes"
|
||||
}
|
||||
|
||||
return $schema;
|
||||
|
|
Загрузка…
Ссылка в новой задаче