|
23 | 23 | -- after this runs. The block is idempotent and safe to repeat; a journaled migration does not |
24 | 24 | -- replay, so the post-drain pass is an operational step, not an automatic one. |
25 | 25 | -- |
26 | | --- 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. |
| 26 | +-- Where 0272 has not yet run, it and this file apply back to back and this becomes a no-op |
| 27 | +-- reconcile over the rows 0272 just wrote. |
28 | 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. |
| 29 | +-- Validated with a read-only dry run that materialises the full post-0272 `folder` table from |
| 30 | +-- both source tables and asserts every constraint the table declares: no NULL names or NULL |
| 31 | +-- required columns, no primary-key collisions between the two source tables, no |
| 32 | +-- `folder_workspace_resource_parent_name_active_unique` violations, no resource-type or |
| 33 | +-- workspace violations of `folder_parent_resource_type_match`, and no parent/user/workspace FK |
| 34 | +-- violations, with every foldered file and workflow keeping a resolvable folder id. |
| 35 | +-- |
| 36 | +-- 0272's dedup renames only workflow folders, never file folders: `workspace_file_folders` |
| 37 | +-- enforces the same active-unique key this table does, so no file folder can arrive duplicated. |
| 38 | +-- That is what lets pass 2 below write raw names. |
38 | 39 |
|
39 | 40 | -- Wrapped in a DO block so the two passes are ONE statement and therefore atomic on their own. |
40 | 41 | -- 0272 ends with an embedded COMMIT (its trailing CONCURRENTLY index builds cannot run inside a |
|
0 commit comments