Package com.onec.schema
Class SchemaHistoryRepository
java.lang.Object
com.onec.schema.SchemaHistoryRepository
Persistence for
onec_schema_history: one row per applied schema change-set
(kind SCHEMA, carrying the metadata snapshot and the DDL that was executed)
and one row per executed AppMigration (kind MIGRATION,
claimed via a unique constraint so concurrent instances run each migration exactly once).-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionappliedMigrationVersions(org.jdbi.v3.core.Jdbi jdbi) voidensure(org.jdbi.v3.core.Jdbi jdbi) latestSnapshotJson(org.jdbi.v3.core.Jdbi jdbi) voidrecordSchema(org.jdbi.v3.core.Jdbi jdbi, String snapshotJson, List<String> appliedDdl, String description) booleantryClaimMigration(org.jdbi.v3.core.Handle handle, String version, String description) Claims a migration version inside the caller's transaction.
-
Field Details
-
TABLE
- See Also:
-
-
Constructor Details
-
SchemaHistoryRepository
public SchemaHistoryRepository()
-
-
Method Details
-
ensure
public void ensure(org.jdbi.v3.core.Jdbi jdbi) -
latestSnapshotJson
-
recordSchema
-
appliedMigrationVersions
-
tryClaimMigration
public boolean tryClaimMigration(org.jdbi.v3.core.Handle handle, String version, String description) Claims a migration version inside the caller's transaction. Returns false when the version is already recorded (applied earlier, or claimed concurrently by another instance — the unique constraint on(_kind, _version)arbitrates).
-