@@ -38,7 +38,7 @@ A **third output adapter**, sibling to the two that already exist:
3838| ---| ---| ---|
3939| homegrown (` write-migration.ts ` ) | ` <ts>-<slug>/up.sql ` + ` down.sql ` | default |
4040| D1/Wrangler (` write-migration-d1.ts ` ) | ` <seq>_<slug>.sql ` + ` .down/<same> ` | ` --dialect d1 ` |
41- | ** Flyway (new)** | ` V<N>__<slug>.sql ` + ` U<N>__<slug>.sql ` | ` --format flyway ` |
41+ | ** Flyway (new)** | ` V<N>__<slug>.sql ` + ` U<N>__<slug>.sql ` | ` --migration- format flyway ` |
4242
4343The diff/emit engine is ** untouched** . It already produces ` { up, down } ` ; an adapter only decides
4444the envelope. This is exactly ADR-0015 §3's model ("the engine generates the up+down SQL once;
@@ -85,13 +85,19 @@ SQL entirely — it discards something already computed, for no gain.
8585Flyway renders the description with underscores as spaces, so ` V4__add_program_view.sql ` is
8686idiomatic. The D1 adapter sanitizes to hyphens; the Flyway adapter must not copy that.
8787
88- ### D4 — ` --format ` flag plus a config key
88+ ### D4 — ` --migration- format ` flag plus a config key
8989
90- ` --format flyway|default ` on ` meta migrate ` , also settable once as ` migrate.format ` in
90+ ` --migration- format flyway|default ` on ` meta migrate ` , also settable once as ` migrate.format ` in
9191** ` .metaobjects/config.json ` ** — the static project-state file the migrate command already reads via
9292` tryLoadConfig ` → SDK ` ConfigSchema.MigrateBlock ` (NOT ` metaobjects.config.ts ` , which carries
9393generator wiring). Flag overrides config; default is ` default ` , so existing behavior is untouched.
9494
95+ ** Corrected during implementation:** this decision originally specified ` --format ` . That name is
96+ already taken by the ** global** output-rendering flag (` toon ` / ` json ` / ` text ` ), consumed in
97+ ` cli/src/index.ts ` before any command sees it — the original check looked only at ` migrate.ts ` and
98+ wrongly concluded it was free. The flag is therefore ` --migration-format ` . The config key stays
99+ ` migrate.format ` : nested under ` migrate ` , it has no such clash.
100+
95101Rationale: a JVM shop sets it once and forgets, while a one-off generation in another format stays
96102possible. Flag-only would mean repeating it forever with a forgotten flag silently writing the wrong
97103layout; config-only would remove the one-off escape.
@@ -115,7 +121,7 @@ existing per-adapter default-fallback pattern: the D1 path already falls back to
115121 in §6.
1161224 . ** ` sdk/src/config.ts ` ** — add ` format ` to the ` MigrateBlock ` Zod schema, so
117123 ` .metaobjects/config.json ` can carry ` migrate.format ` .
118- 5 . ** ` cli/src/lib/args.ts ` ** — ` --format ` in ` parseMigrateArgs ` + ` MigrateFlags ` , validated against
124+ 5 . ** ` cli/src/lib/args.ts ` ** — ` --migration- format ` in ` parseMigrateArgs ` + ` MigrateFlags ` , validated against
119125 the closed set (invalid value → parse error, matching the existing ` --dialect ` handling).
120126
121127## 5. Data flow
@@ -140,10 +146,10 @@ by #226/#241 (D1 FK cascade) and #258 (PK move):
140146
141147| Combination | Refusal reason |
142148| ---| ---|
143- | ` --format flyway --apply ` | Applying behind Flyway desyncs ` flyway_schema_history ` → use ` flyway migrate ` |
144- | ` --format flyway apply-pending ` | Same — replaying committed migrations is Flyway's job |
145- | ` --format flyway --rollback ` | Our ledger does not exist on a Flyway-managed DB → ` flyway undo ` (Teams) or roll forward |
146- | ` --format flyway --dialect d1 ` | D1 has its own Wrangler layout and wrangler transport; the combination is meaningless |
149+ | ` --migration- format flyway --apply ` | Applying behind Flyway desyncs ` flyway_schema_history ` → use ` flyway migrate ` |
150+ | ` --migration- format flyway apply-pending ` | Same — replaying committed migrations is Flyway's job |
151+ | ` --migration- format flyway --rollback ` | Our ledger does not exist on a Flyway-managed DB → ` flyway undo ` (Teams) or roll forward |
152+ | ` --migration- format flyway --dialect d1 ` | D1 has its own Wrangler layout and wrangler transport; the combination is meaningless |
147153
148154Non-fatal behaviors:
149155
@@ -159,7 +165,7 @@ Non-fatal behaviors:
159165versions (` V10.5__ ` ) → ` V11 ` ; ` U__ ` files do ** not** bump the counter; slug sanitized to underscores;
160166trailing newline on both files.
161167
162- ** CLI:** the four refusals in §6, each asserting exit code and message; ` --format ` precedence
168+ ** CLI:** the four refusals in §6, each asserting exit code and message; ` --migration- format ` precedence
163169(flag > config > default); dir resolution (` --out-dir ` vs the Flyway convention default).
164170
165171** Real-engine gate (required).** Every migrate change in this repo carries it, because a green unit
@@ -183,7 +189,7 @@ pass unchanged.
183189
184190- The other ADR-0015 adapters (two-file ` .up.sql ` /` .down.sql ` , single-file-with-divider for
185191 dbmate/goose, Liquibase formatted-SQL). This design deliberately builds only the reference adapter;
186- the others become mechanical once the ` --format ` axis exists.
192+ the others become mechanical once the ` --migration- format ` axis exists.
187193- Restoring any Java-side migrate goal. Schema stays TS-owned per ADR-0015; JVM consumers run the
188194 Node ` meta ` CLI for migration generation.
189195- Closing the engine's modeling gaps (triggers, cross-column CHECKs, function-valued defaults, GIN
0 commit comments