Skip to content

Commit 312603d

Browse files
authored
Merge pull request #59855 from nextcloud/mounts-index-swap-path_root-33
2 parents 2ab70ae + 6ac0004 commit 312603d

2 files changed

Lines changed: 9 additions & 1 deletion

File tree

core/Listener/AddMissingIndicesListener.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -223,5 +223,13 @@ public function handle(Event $event): void {
223223
['user', 'mountpoint'],
224224
['lengths' => [null, 128]]
225225
);
226+
227+
$event->replaceIndex(
228+
'mounts',
229+
['mounts_user_root_path_index'],
230+
'mounts_user_path_root_index',
231+
['user_id', 'mount_point_hash', 'root_id'],
232+
true,
233+
);
226234
}
227235
}

core/Migrations/Version33000Date20251209123503.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ public function changeSchema(IOutput $output, Closure $schemaClosure, array $opt
4242
if ($table->hasIndex('mounts_user_root_path_index')) {
4343
$table->dropIndex('mounts_user_root_path_index');
4444
}
45-
$table->addUniqueIndex(['user_id', 'root_id', 'mount_point_hash'], 'mounts_user_root_path_index');
45+
$table->addUniqueIndex(['user_id', 'mount_point_hash', 'root_id'], 'mounts_user_path_root_index');
4646
return $schema;
4747
}
4848

0 commit comments

Comments
 (0)