You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(db): dedupe every re-root path in the folder contract migration
The migration re-roots rows in three places and each lands them in a namespace
covered by a partial unique index keyed on a coalesced nullable column, so a
name that is free in the source scope can already be taken in the destination.
- step 1's free-suffix probe only consulted the folder table, so a stranded row
keeping the name 'X (1)' was invisible to the probe run for a stranded 'X' and
both were assigned the same name
- step 2 re-rooted dangling folder_ids to NULL with no dedupe at all, colliding
on the workflow and workspace_files active-unique indexes
- a stranded folder whose parent lives in another workspace passed the parent
resolver but fails the folder_parent_resource_type_match trigger
Also re-roots active children before the retention sweep hard-deletes a folder:
the new ON DELETE SET NULL would otherwise collide on those same indexes, and
the batch delete turns that into a permanent stall.
0 commit comments