fix(mounts): only remove existing index

Signed-off-by: Maxence Lange <maxence@artificial-owl.com>
This commit is contained in:
Maxence Lange 2026-01-15 16:13:12 -01:00 committed by provokateurin
parent 2c76338e64
commit 8c257def95
No known key found for this signature in database

View file

@ -39,7 +39,9 @@ class Version33000Date20251209123503 extends SimpleMigrationStep {
'notnull' => true,
'length' => 32, // xxh128
]);
$table->dropIndex('mounts_user_root_path_index');
if ($table->hasIndex('mounts_user_root_path_index')) {
$table->dropIndex('mounts_user_root_path_index');
}
$table->addUniqueIndex(['user_id', 'root_id', 'mount_point_hash'], 'mounts_user_root_path_index');
return $schema;
}