Skip to content

Commit 77a5c46

Browse files
dmealingclaude
andcommitted
refactor(omdb)!: remove meta:migrate goal + Java migration-conformance scenarios
Removes the consumers of the diff-and-converge schema-migration engine so the engine itself can be deleted atomically in a follow-up commit. Schema migrations (and live-DB schema-drift verification) move to the TypeScript toolchain (@metaobjectsdev/cli migrate); the Java port retains runtime persistence only. Maven plugin: - Delete MetaDataMigrateMojo (the meta:migrate goal) and its two tests. - Delete MetaDataVerifyMojo. The meta:verify goal was a thin subclass of the migrate mojo providing a live-DB schema-drift gate (SchemaMigrationEngine.verify), so it is part of the migration subsystem, not an independent codegen/metadata check. Prompt/template drift is still checked via the metaobjects-render Verify API; meta:gen and meta:editor are unaffected. - Update server/java/README to list meta:gen / meta:editor only. integration-tests: - Delete MigrationScenarioRunner + MigrationScenarioTests; drop the migration record types from Scenarios and the migration parsing from ScenarioLoader. Java permanently stops running migration-conformance scenarios. - Re-point QueryScenarioRunner's schema bootstrap off SchemaMigrationEngine onto the retained runtime auto-create path (MetaClassDBValidatorService + the drivers' legacy createTable/createIndex/createForeignKey/createSequence DDL). - Defer the projection-aggregate query scenario: its aggregate-view body was synthesized by the engine's ViewBodyBuilder (removed); runtime auto-create only materializes views from an explicit dbViewSQL attr. omdb: - Quote column/PK/index/FK identifiers in PostgresDriver's legacy createTable/ createIndex/createForeignKey so the runtime auto-create path produces a mixed-case-correct Postgres schema, matching the already-quoted CRUD/SELECT path. Previously masked because only the engine built the Postgres conformance schema; the legacy DDL was only exercised against lowercase Derby fixtures. The migrate/ package still compiles (now unused) and is deleted in the next commit. Verified: om/omdb/maven-plugin/core-spring/omdb-ktx green; integration-tests green under Docker (query 9 pass + 1 deferred, api-contract 20, float 4). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent 95c26e6 commit 77a5c46

12 files changed

Lines changed: 39 additions & 1139 deletions

File tree

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/integration-tests/src/test/java/com/metaobjects/integration/MigrationScenarioRunner.java

Lines changed: 0 additions & 246 deletions
This file was deleted.

server/java/integration-tests/src/test/java/com/metaobjects/integration/MigrationScenarioTests.java

Lines changed: 0 additions & 60 deletions
This file was deleted.

server/java/integration-tests/src/test/java/com/metaobjects/integration/QueryScenarioRunner.java

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,7 @@
66
import com.metaobjects.manager.ObjectConnection;
77
import com.metaobjects.manager.db.ObjectManagerDB;
88
import com.metaobjects.manager.db.driver.PostgresDriver;
9-
import com.metaobjects.manager.db.migrate.AllowOptions;
10-
import com.metaobjects.manager.db.migrate.EmitResult;
11-
import com.metaobjects.manager.db.migrate.SchemaMigrationEngine;
9+
import com.metaobjects.manager.db.validator.MetaClassDBValidatorService;
1210
import com.metaobjects.object.MetaObject;
1311
import com.metaobjects.registry.MetaDataLoaderRegistry;
1412
import com.metaobjects.registry.ServiceRegistryFactory;
@@ -28,9 +26,12 @@
2826
/**
2927
* Mirrors C# QueryScenarioRunner / TS query-scenario.ts. End-to-end:
3028
*
31-
* 1. Apply the canonical schema (engine full-CREATE via
32-
* {@link SchemaMigrationEngine#emit(Connection, AllowOptions)} against
33-
* an empty actual snapshot).
29+
* 1. Apply the canonical schema via the runtime auto-create path
30+
* ({@link MetaClassDBValidatorService} with {@code autoCreate=true},
31+
* which issues the drivers' legacy {@code createTable}/{@code createIndex}/
32+
* {@code createForeignKey}/{@code createSequence} DDL). Schema migrations
33+
* (diff-and-converge) are owned by the TS toolchain; the Java port only
34+
* retains runtime auto-create for test/dev schema bootstrap.
3435
* 2. Execute the scenario's seed-data SQL.
3536
* 3. For each {@link QuerySpec}: translate via {@link ObjectManagerDbAdapter}
3637
* → {@link ObjectManagerDB#getObjects} / {@code getObjectsCount},
@@ -48,13 +49,14 @@ public static void run(QueryScenario scenario, PostgresContainer pg, Path canoni
4849
registry.registerLoader(loader);
4950

5051
ObjectManagerDB omdb = newOmdb(pg);
51-
SchemaMigrationEngine engine = new SchemaMigrationEngine(omdb, registry);
5252

53-
// 1. Apply canonical schema.
54-
try (Connection c = openConnection(pg)) {
55-
EmitResult emit = engine.emit(c, new AllowOptions());
56-
executeSql(c, emit.up());
57-
}
53+
// 1. Apply canonical schema via the runtime auto-create path (the
54+
// drivers' legacy createTable/createIndex/createForeignKey DDL).
55+
MetaClassDBValidatorService validator = new MetaClassDBValidatorService();
56+
validator.setObjectManager(omdb);
57+
validator.setAutoCreate(true);
58+
validator.setMetaDataLoaderRegistry(registry);
59+
validator.init();
5860

5961
// 2. Seed data.
6062
if (scenario.seedData() != null && !scenario.seedData().isBlank()) {

0 commit comments

Comments
 (0)