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
Copy file name to clipboardExpand all lines: docs/features/migrations-and-drift.md
+5-5Lines changed: 5 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -13,7 +13,7 @@ There are **7 drift sources**, and the toolchain has a guard for each.
13
13
|---|---|---|
14
14
|**Code-vs-DB**| Codegen — the generated SQL DDL is emitted from the same metadata as the entity / table code. | Build time |
15
15
|**Code-vs-API-doc**| Cross-port codegen from the same metadata. | Build time |
16
-
|**DB-vs-metadata**|`meta verify --db` (TS CLI) — introspects the live DB and fails if it has drifted from metadata. Java/Kotlin: runtime startup validator (`MetaClassDBValidatorService`) catches generated-table drift at app startup; the removed `meta:verify` Maven goal is not available. | CI on every PR (TS); app startup (Java/Kotlin)|
16
+
|**DB-vs-metadata**|`meta verify --db` (TS CLI) — introspects the live DB and fails if it has drifted from metadata. This is a schema concern owned by the Node toolchain regardless of server language; on the JVM ports the runtime auto-create/validator path was removed (ADR-0015) and the `meta:verify` Maven goal is not available. | CI on every PR |
17
17
|**Migration-vs-metadata**|`meta migrate` (TS / C# / Python) emits migrations FROM metadata diffs — they cannot drift from metadata by construction. Java/Kotlin schema migrations are also owned by the TS toolchain (`@metaobjectsdev/cli migrate`). | Build time |
18
18
|**Generated-edited**|`@generated` headers in emitted code + three-way merge that preserves hand-edits inside non-generated regions. | Code review |
19
19
|**Prompt-vs-payload**| FR-004 `Renderer.verify` parses `{{...}}` references in templates and checks each one exists on the payload VO. | Build time + runtime |
@@ -59,9 +59,9 @@ configured in `metaobjects.config.ts` (typically `./migrations/<timestamp>__<slu
59
59
60
60
Schema migrations for Java projects are owned by the **TypeScript toolchain**
61
61
(`@metaobjectsdev/cli migrate`). The Java Maven plugin's `meta:migrate` goal was
62
-
removed. Java retains a dev/test runtime auto-create path via
63
-
`MetaClassDBValidatorService` (the drivers' `createTable` DDL), not a migration
64
-
engine.
62
+
removed, and per ADR-0015 the OMDB runtime auto-create path was removed too —
63
+
OMDB is pure data-access (CRUD/query/codec/transactions). Provision the schema by
64
+
applying the TS-produced DDL/migrations to the database the Java service connects to.
65
65
66
66
Use the TS CLI against the same database the Java service connects to:
67
67
@@ -108,7 +108,7 @@ for current status.)
108
108
| Port | Command | What it does |
109
109
|---|---|---|
110
110
| TypeScript |`meta verify --db`| Introspects the live DB; reports DB-vs-metadata drift. |
111
-
| Java |`Renderer.verify` (build-time) + `MetaClassDBValidatorService` (startup) | Template-drift: verifies `{{...}}` references resolve against the payload VO. Live-DB-schema drift: startup validator asserts generated table objects match metadata. The `meta:verify` Maven goal (live-DB introspection) was removed. |
111
+
| Java |`Renderer.verify` (build-time) | Template-drift: verifies `{{...}}` references resolve against the payload VO. Live-DB-schema drift is TS-owned (`meta verify --db`); both the `meta:verify` Maven goal and the runtime auto-create validator were removed (ADR-0015). |
112
112
| Kotlin |`Renderer.verify` (build-time) + `MetadataStartupValidator` (startup) | Same as Java — template-drift and startup validation. No `meta:verify` Maven goal. |
113
113
| C# |`meta verify ./metadata --templates ./prompts`| Drift-checks templates against their payload VOs (FR-004 prompt-drift). |
114
114
| Python |`python -m metaobjects.render.verify`| Same as C# verify — template-vs-payload drift. |
| Payload-VO codegen | Yes — `SpringPayloadGenerator` (in `metaobjects-codegen-spring`) emits a Java 21 `record` per template, mirrors the Kotlin shape |
249
249
| Output parser codegen (FR-006) | Not yet — see note below |
250
-
| Migrations | TS-only (`@metaobjectsdev/cli migrate`) — the Java engine was removed; OMDB offers runtime auto-create for dev/test only|
250
+
| Migrations | TS-only (`@metaobjectsdev/cli migrate`) — the Java migration engine and the OMDB runtime auto-create path were both removed (ADR-0015); apply the TS-produced DDL to the database|
251
251
| Drift verify |`Renderer.verify` / `Verify.verify` (prompts). Live-DB schema-drift verification is part of the TS migration toolchain |
252
252
| Runtime metadata | Full — OMDB ObjectManager |
253
253
| REST controller codegen | Spring Web MVC — `metaobjects-codegen-spring` (FR-008 §2.1) |
0 commit comments