Skip to content

Commit 01dc6a9

Browse files
committed
docs(folders): record the 0272 + 0274 dry-run results on the migration
Read-only dry-run against production materialised the complete post-0272 `folder` table from both source tables and checked every constraint it declares: 34,991 rows, 0 NULL names, 0 PK collisions between the two source tables, 0 unique-index violations, 0 resource-type or workspace trigger violations, and 0 parent/user/workspace FK violations. 0272 renames 47 workflow folders and 0 file folders — the latter is what lets pass 2 write raw names.
1 parent ef2b19c commit 01dc6a9

1 file changed

Lines changed: 11 additions & 4 deletions

File tree

packages/db/migrations/0274_file_folder_cutover_reconcile.sql

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,17 @@
2424
-- replay, so the post-drain pass is an operational step, not an automatic one.
2525
--
2626
-- On an environment where 0272 has not yet run — production at time of writing — 0272 and this
27-
-- file apply back to back and this is a no-op reconcile over the rows 0272 just wrote. Verified
28-
-- against production: 1,493 legacy file folders, 0 active name duplicates, 0 orphaned parents,
29-
-- 0 cross-workspace parents, and 0 id collisions with `workflow_folder`, so the insert path
30-
-- cannot trip the unique index, the FKs, or the resource-type trigger.
27+
-- file apply back to back and this is a no-op reconcile over the rows 0272 just wrote.
28+
--
29+
-- Dry-run against production (read-only), materialising the full post-0272 `folder` table from
30+
-- both source tables and checking every constraint the table declares: 34,991 rows, and 0 of
31+
-- each of — NULL names, NULL required columns, primary-key collisions between the two source
32+
-- tables, `folder_workspace_resource_parent_name_active_unique` violations, resource-type or
33+
-- workspace violations of `folder_parent_resource_type_match`, and parent/user/workspace FK
34+
-- violations. Longest generated name 55 chars. 0272's dedup renames 47 workflow folders and 0
35+
-- file folders (the legacy table's own active-unique index guarantees the latter, which is why
36+
-- pass 2 below can write raw names). All 5,475 foldered files and 4,593 foldered workflows keep
37+
-- a resolvable folder id.
3138

3239
-- Wrapped in a DO block so the two passes are ONE statement and therefore atomic on their own.
3340
-- 0272 ends with an embedded COMMIT (its trailing CONCURRENTLY index builds cannot run inside a

0 commit comments

Comments
 (0)