|
6 | 6 | * ceremony verified on this database? |
7 | 7 | * |
8 | 8 | * A v18 runtime declares no organization column on the ceremony's |
9 | | - * column-drop tables (the D7 tables and the `sys_metadata` family), so the |
10 | | - * drift report lists each physical one as an unmapped, destructive column and |
| 9 | + * column-drop tables (the D7 tables, the platform's and the ones a deployment |
| 10 | + * declares platform-global, and the `sys_metadata` family), so the drift |
| 11 | + * report lists each physical one as an unmapped, destructive column and |
11 | 12 | * names `os migrate apply --allow-destructive` as its remedy. Applied ahead of |
12 | 13 | * the ceremony, that drop skips its promotion and report steps, turns every |
13 | 14 | * legacy organization row into an environment row, and leaves no physical |
14 | 15 | * column for the v18 boot refusal to find — so the server starts with the |
15 | 16 | * marker never written. D10 item 5 forbids exactly that escape hatch. So the |
16 | | - * drop of `organization_id` on any table in the ceremony's inventory waits for |
17 | | - * the ceremony's verified marker, as `sys_account.issuer` (#17440) and |
| 17 | + * drop of `organization_id` on any table the ceremony plans waits for the |
| 18 | + * ceremony's verified marker, as `sys_account.issuer` (#17440) and |
18 | 19 | * `sys_comment.reactions` (#23281) wait for theirs. ⛔ No flag stands it down. |
| 20 | + * |
| 21 | + * ## Which tables: every `organization_id` drop the drift offers (#23684) |
| 22 | + * |
| 23 | + * The ceremony's table set is the database's, not a list's: its plan meets |
| 24 | + * every physical table that carries `organization_id`, with the platform |
| 25 | + * inventory's row, a host fate supplement's row, the application-object fate, |
| 26 | + * or a refusal by name (`organization-ownership-plan.ts`). The drift can offer |
| 27 | + * to drop only a column that is physically there. So every `organization_id` |
| 28 | + * drop it offers is on a table the ceremony plans, and this gate holds back |
| 29 | + * every one: the platform inventory's tables, the objects a deployment |
| 30 | + * declares platform-global (ADR-0131 D7), and the objects a host's fate |
| 31 | + * supplement names, a file `os migrate apply` is never handed. The v18 boot |
| 32 | + * refusal judges the same population, every object that declares no |
| 33 | + * organization column, not the inventory. |
| 34 | + * |
| 35 | + * Reading the drift rather than a composed table list keeps one source: no |
| 36 | + * second copy of the ceremony's inventory composition, and no part of the |
| 37 | + * answer this command could fail to read. |
19 | 38 | */ |
20 | 39 |
|
21 | 40 | import type { MigrationFlagEngine } from '@objectstack/platform-objects/system'; |
22 | 41 | import type { DataMigrationFlag } from '@objectstack/spec/system'; |
23 | | -import { ORGANIZATION_OWNERSHIP_INVENTORY } from './organization-ownership-inventory.js'; |
24 | 42 |
|
25 | 43 | /** The column the ceremony owns the drop of. */ |
26 | 44 | export const ORGANIZATION_COLUMN = 'organization_id'; |
27 | 45 |
|
28 | | -/** Every table the ceremony's inventory names. */ |
29 | | -const CEREMONY_TABLES: ReadonlySet<string> = new Set(ORGANIZATION_OWNERSHIP_INVENTORY.map((entry) => entry.object)); |
30 | | - |
31 | | -/** The tables whose `organization_id` drop is among `intended`, sorted. */ |
| 46 | +/** The tables whose `organization_id` drop is among `intended`, sorted: every one, since the ceremony plans each table that carries the column. */ |
32 | 47 | export function ceremonyOrganizationColumnDrops( |
33 | 48 | intended: ReadonlyArray<{ table: string; op?: { type?: string; column?: string } }>, |
34 | 49 | ): string[] { |
35 | 50 | const tables = new Set<string>(); |
36 | 51 | for (const d of intended) { |
37 | | - if (d.op?.type === 'drop_column' && d.op.column === ORGANIZATION_COLUMN && CEREMONY_TABLES.has(d.table)) tables.add(d.table); |
| 52 | + if (d.op?.type === 'drop_column' && d.op.column === ORGANIZATION_COLUMN) tables.add(d.table); |
38 | 53 | } |
39 | 54 | return [...tables].sort(); |
40 | 55 | } |
|
0 commit comments