Skip to content

Commit cad31c3

Browse files
dmealingclaude
andcommitted
Merge omdb-migration-removal: Phase 1 — remove OMDB schema-migration engine (TS-only migrations)
Removes the diff-and-converge engine (migrate/*, MigrationSqlRenderer + driver render(Change)), the meta:migrate + live-DB-drift meta:verify Maven goals, and the Java migration-conformance scenarios. OMDB retains runtime persistence + (for now) the dev/test runtime auto-create path. Phase 1 of the TS-schema- authority consolidation (spec 2026-05-30); schema verify/migrate move to the TS meta CLI. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2 parents 043aed6 + 45b205a commit cad31c3

49 files changed

Lines changed: 75 additions & 3371 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

CLAUDE.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ _Last refreshed 2026-05-27._
2525

2626
- **TypeScript**`codegen-ts` (Vite-style plugins; Drizzle, Zod, Fastify) + `runtime-ts` + `migrate-ts` + the universal web client packages (`runtime-web`, `react`, `tanstack`).
2727
- **C#**`MetaObjects` (loader + canonical serializer + conformance) + `MetaObjects.Render` (Mustache + payload-VO + `verify`) + `MetaObjects.Codegen` (EF Core entities + `AppDbContext` + CRUD minimal-API routes + Postgres DDL via full-CREATE and incremental introspect/diff/migrate). The `meta` CLI (`verify`/`gen`/`migrate`/`--from-db`) is the entry point.
28-
- **Java**`metadata` + `omdb` + `om` + `dynamic` + `core-spring` + `metadata-ktx` (Kotlin facade) + `codegen-spring` (Spring controllers + DTOs + repositories + filter allowlists + payload records + output parsers) + `codegen-mustache` + `codegen-plantuml` + `render` + `maven-plugin` (`meta:gen`/`meta:migrate`/`meta:verify`). FR-003 (OMDB persistence + diff-and-converge migration + binding registry + typed jsonb + Spring-tx + source/origin metamodel) fully shipped, including Plan 4 (engine-debt remediation: atomic mapping cache, JDBC codec registry, `inTransaction` template).
28+
- **Java**`metadata` + `omdb` + `om` + `dynamic` + `core-spring` + `metadata-ktx` (Kotlin facade) + `codegen-spring` (Spring controllers + DTOs + repositories + filter allowlists + payload records + output parsers) + `codegen-mustache` + `codegen-plantuml` + `render` + `maven-plugin` (`meta:gen`/`meta:editor`). FR-003 (OMDB runtime persistence + binding registry + typed jsonb + Spring-tx + source/origin metamodel) fully shipped, including Plan 4 (engine-debt remediation: atomic mapping cache, JDBC codec registry, `inTransaction` template). **Schema migrations are owned by the TypeScript toolchain** (`@metaobjectsdev/cli migrate`); the Java port's diff-and-converge migration engine and its `meta:migrate` / live-DB-drift `meta:verify` Maven goals were removed — OMDB retains runtime persistence + a dev/test runtime auto-create path (`MetaClassDBValidatorService` + the drivers' legacy `createTable` DDL) only.
2929
- **Python**`metaobjects` (loader + canonical serializer + conformance + render + verify + codegen) + `migrate` + an `ObjectManager` runtime layer. All five conformance corpora green.
3030
- **Kotlin**`codegen-kotlin` (KotlinPoet on JVM): entity + Exposed table + Spring controller + payload + relations + filter allowlist + validator + stored-proc + output-parser generators. `integration-tests-kotlin` runs the persistence-conformance corpus through Exposed against Testcontainers Postgres.
3131

@@ -36,7 +36,7 @@ _Last refreshed 2026-05-27._
3636
- API-contract: `fixtures/api-contract-conformance/`. TS / C# / Java / Kotlin / Python all 20/20.
3737
- YAML / verify corpora green across the ports that ship those layers.
3838

39-
**Key cross-language features shipped:** FR5 family (a/b/c/d/e + WARN envelope-shape — actionable loader errors per ADR-0009); FR-003 (Java RDB persistence + meta migrate + projections); FR-006 (template.output parser-on-receipt codegen per ADR-0010 in all 5 ports); FR-008 + FR-009 (cross-port REST API contract + 10 filter operators); source v2 paradigm (ADR-0007); metadata-ktx Kotlin facade; per-target output directories (TS codegen).
39+
**Key cross-language features shipped:** FR5 family (a/b/c/d/e + WARN envelope-shape — actionable loader errors per ADR-0009); FR-003 (Java RDB runtime persistence + projections; schema migrations are TS-only — the Java migration engine was removed); FR-006 (template.output parser-on-receipt codegen per ADR-0010 in all 5 ports); FR-008 + FR-009 (cross-port REST API contract + 10 filter operators); source v2 paradigm (ADR-0007); metadata-ktx Kotlin facade; per-target output directories (TS codegen).
4040

4141
**Current release line.** `0.7.0-rc.2` accumulates the 0.6.x → 0.7.0 consumer-friction batch (stock `promptRender()` generator, `db`-parameter generated repo helpers per ADR-0008, Cloudflare Workers deploy recipe, CHANGELOG backfill + naming-convention docs) plus the FR5 + FR-003 Plan 4 + FR-006 Java work. GA promotion is the next release move.
4242

docs/ports/java.md

Lines changed: 18 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,14 @@
11
# Java port
22

33
The Java port targets Spring-Boot consumers on Maven. It ships the full metamodel
4-
+ loader + conformance + OMDB persistence engine + the FR-004 render engine, plus
5-
the `metaobjects-maven-plugin` for build-time codegen + drift verification +
6-
migration emission.
4+
+ loader + conformance + OMDB runtime persistence engine + the FR-004 render engine,
5+
plus the `metaobjects-maven-plugin` for build-time codegen (`meta:gen` / `meta:editor`).
6+
7+
Schema migrations are owned by the TypeScript toolchain (`@metaobjectsdev/cli migrate`);
8+
the Java diff-and-converge migration engine and its `meta:migrate` / live-DB-drift
9+
`meta:verify` Maven goals were removed. OMDB retains runtime persistence and a
10+
dev/test runtime auto-create path (`MetaClassDBValidatorService`) only. Prompt /
11+
template drift is still checked via the `metaobjects-render` `Verify` API.
712

813
## Install
914

@@ -58,11 +63,6 @@ For Spring integration: add `metaobjects-core-spring`.
5863
</generators>
5964
</configuration>
6065
</execution>
61-
<execution>
62-
<id>verify</id>
63-
<phase>verify</phase>
64-
<goals><goal>verify</goal></goals>
65-
</execution>
6666
</executions>
6767
</plugin>
6868
</plugins>
@@ -135,12 +135,13 @@ in tests or embedded scenarios. The conceptual reference lives in
135135

136136
```bash
137137
mvn compile # runs the generate goal (bound to generate-sources)
138-
mvn meta:migrate # emit a migration SQL file
139-
mvn meta:migrate -Dflyway=true # emit V<N>__<slug>.sql under src/main/resources/db/migration/
140-
mvn meta:verify # introspect live DB; fail if drifted
141-
mvn verify # full verify phase (incl. meta:verify)
142138
```
143139

140+
Schema migrations are not a Java-port concern — author them with the TypeScript
141+
toolchain (`@metaobjectsdev/cli migrate`). OMDB's runtime auto-create path can
142+
bootstrap a dev/test schema at startup (`MetaClassDBValidatorService` with
143+
`autoCreate=true`), but it is not a migration tool.
144+
144145
## Use
145146

146147
OMDB reads the same metadata at runtime and drives CRUD; no per-entity ORM
@@ -201,7 +202,8 @@ String out = Renderer.render(RenderRequest.builder()
201202
```
202203

203204
`Verify.verify(loader, provider, options)` drift-checks every `template.*` node
204-
against its `@payloadRef`. Wire it into a Maven test or the `verify` goal.
205+
against its `@payloadRef`. Wire it into a Maven test (e.g. a JUnit assertion in
206+
the `test` phase).
205207

206208
## Generators
207209

@@ -245,8 +247,8 @@ configuration model that has not yet been specced.
245247
| Templates + render (FR-004) | Yes (`metaobjects-render`) |
246248
| Payload-VO codegen | Yes — `SpringPayloadGenerator` (in `metaobjects-codegen-spring`) emits a Java 21 `record` per template, mirrors the Kotlin shape |
247249
| Output parser codegen (FR-006) | Not yet — see note below |
248-
| Migrations | `mvn meta:migrate` / `mvn meta:migrate -Dflyway=true` |
249-
| Drift verify | `mvn meta:verify` (DB) + `Renderer.verify` (prompts) |
250+
| Migrations | TS-only (`@metaobjectsdev/cli migrate`) — the Java engine was removed; OMDB offers runtime auto-create for dev/test only |
251+
| Drift verify | `Renderer.verify` / `Verify.verify` (prompts). Live-DB schema-drift verification is part of the TS migration toolchain |
250252
| Runtime metadata | Full — OMDB ObjectManager |
251253
| REST controller codegen | Spring Web MVC — `metaobjects-codegen-spring` (FR-008 §2.1) |
252254

@@ -267,7 +269,7 @@ that ships, the Jackson one-liner pairs naturally with the generated record.
267269
| YAML authoring (`fixtures/yaml-conformance/`) | 12 / 13 (1 ledgered — `yaml-quoted-leading-zero`, Java pipeline strips quotes off `"007"`) |
268270
| Render (`fixtures/render-conformance/`) | 14 / 14 |
269271
| Verify (`fixtures/verify-conformance/`) | 31 / 31 |
270-
| Persistence (`fixtures/persistence-conformance/`) | 12 / 12 |
272+
| Persistence (`fixtures/persistence-conformance/`) | Query scenarios 9 / 10 (1 deferred: aggregate-projection view body was part of the removed migration engine). Java no longer runs the migration scenarios. |
271273
| API contract (`fixtures/api-contract-conformance/`) | 20 / 20 |
272274

273275
## See also

fixtures/persistence-conformance/README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,11 @@ fixtures/persistence-conformance/
3434
Test the schema-evolution pipeline. Each scenario carries its own metadata
3535
states; the runner applies the migration and asserts SQL and / or post-DDL state.
3636

37+
> The **Java** port does not run the migration scenarios: schema migrations are
38+
> owned by the TypeScript toolchain and the Java diff-and-converge engine was
39+
> removed. The Java runner exercises the **query** scenarios only, bootstrapping
40+
> the schema via OMDB's runtime auto-create path.
41+
3742
```yaml
3843
name: add-nullable-column-to-existing-table
3944
description: A new nullable column on an existing table → ADD COLUMN, no allow flags.

server/java/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ All published to Maven Central under `com.metaobjects:*` at `7.1.0`:
3333
| `metaobjects-omdb` | Relational implementation of ObjectManager over JDBC + Spring-tx |
3434
| `metaobjects-omdb-ktx` | Kotlin facade over OMDB |
3535
| `metaobjects-core-spring` | Spring auto-configuration + `MetaDataService` |
36-
| `metaobjects-maven-plugin` | `mvn meta:gen` / `meta:migrate` / `meta:verify` |
36+
| `metaobjects-maven-plugin` | `mvn meta:gen` / `meta:editor` |
3737

3838
The `archetype` and `examples` directories were removed in 7.1.0 (they had been out of the reactor since 7.0.0 and were not deployed to Central).
3939

@@ -62,7 +62,7 @@ Spring REST + JPA stack:
6262
</dependency>
6363
```
6464

65-
Maven plugin for `meta:gen` / `meta:migrate` / `meta:verify`:
65+
Maven plugin for `meta:gen` / `meta:editor` (schema migrations and live-DB schema-drift verification are managed by the TypeScript toolchain — `@metaobjectsdev/cli migrate`; prompt/template drift is checked via the `metaobjects-render` `Verify` API):
6666

6767
```xml
6868
<plugin>

server/java/codegen-kotlin/README.md

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -148,16 +148,17 @@ No hand-written Exposed wiring needed.
148148
|---|---|---|
149149
| Code-vs-DB | Codegen (`KotlinEntityGenerator` + `KotlinExposedTableGenerator`) | Build time |
150150
| Code-vs-API-doc | Cross-port codegen from same metadata | Build time |
151-
| DB-vs-metadata | `meta:verify` Maven goal | CI on every PR |
152-
| Migration-vs-metadata | `meta:migrate --flyway` emits migrations FROM metadata diffs | Build time |
151+
| DB-vs-metadata, Migration-vs-metadata | TypeScript toolchain (`@metaobjectsdev/cli migrate`) — schema migrations and live-DB schema-drift verification are TS-only | Build time / CI |
153152
| Generated-edited | `@generated` headers in KotlinPoet output | Code review |
154153
| Prompt-vs-payload | `KotlinPayloadGenerator` + Java `Renderer.verify` | Build time + runtime |
155154
| Generated-vs-runtime | `MetadataStartupValidator.validate(loader)` from Spring `ApplicationReadyEvent` | App startup |
156155

157-
## Maven plugin extensions
156+
## Schema migrations
158157

159-
- **`meta:migrate --flyway`** — emits `V<N>__<slug>.sql` into `src/main/resources/db/migration/` (configurable via `<flywayDir>` / `<flywayPrefix>`). Auto-versions by scanning existing migrations.
160-
- **`meta:verify`** — CI drift gate: introspects the live DB and fails the build if it has drifted from metadata-declared schema.
158+
Schema migrations (and live-DB schema-drift verification) are owned by the
159+
TypeScript toolchain (`@metaobjectsdev/cli migrate`). The JVM-side Maven plugin's
160+
`meta:migrate` / `meta:verify` goals were removed along with the Java
161+
diff-and-converge engine; the Maven plugin ships `meta:gen` / `meta:editor` only.
161162

162163
## Cross-port codegen conformance (deferred)
163164

server/java/codegen-spring/src/main/java/com/metaobjects/generator/spring/RecoverSchemaEmitter.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,7 @@ private static String constructorArgForField(MetaField<?> field) {
229229
/**
230230
* Returns {@code true} when the field carries {@code @required: true}.
231231
* Uses {@code getValueAsString()} to handle both the Boolean-attribute and
232-
* String-attribute storage paths (mirrors {@code ExpectedSchemaBuilder.isRequired}).
232+
* String-attribute storage paths.
233233
*/
234234
private static boolean isRequired(MetaField<?> field) {
235235
return field.hasMetaAttr(MetaField.ATTR_REQUIRED)

0 commit comments

Comments
 (0)