Buyer / migration-safety gap
Protected develop@622e5e6c3d534f230c390f10e3832efadfc01825 enables both Flyway migration management and Hibernate automatic schema mutation in the deployable ETL service:
spring:
flyway:
baseline-on-migrate: ${FLYWAY_BASELINE_ON_MIGRATE:false}
baseline-version: 0
clean-disabled: true
validate-migration-naming: true
jpa:
hibernate:
ddl-auto: update
The active durable-job work already depends on ordered, reviewed Flyway migrations and explicit rollback/forward-recovery evidence. A second runtime DDL authority (ddl-auto: update) makes acquisition-grade schema provenance ambiguous even if it currently happens to find no mapped entity requiring a mutation.
Spring Boot's maintained database-initialization guidance recommends a single mechanism for schema generation and states that when using a higher-level migration tool such as Flyway or Liquibase, it should be used alone to create/initialize the schema. ddl-auto values include none, validate, update, create, and create-drop; non-embedded databases with a schema manager otherwise default to none when not explicitly overridden.
Primary implementation reference to reverify at mutation time: Spring Boot Database Initialization documentation (docs.spring.io/spring-boot/how-to/data-initialization.html).
RCA
- Immediate cause: deployable ETL configuration explicitly forces Hibernate
ddl-auto: update while also enabling Flyway.
- Technical root cause: database schema authority is split between versioned migration artifacts and runtime ORM introspection/mutation.
- Systemic/control cause: the repository has strong per-migration tests but no startup/configuration invariant saying protected schema changes may occur only through reviewed migration paths.
- Detection failure: current source contains no obvious
@Entity production type, which can make ddl-auto:update appear inert and allow the unsafe authority to persist unnoticed. Inert today is not a valid schema-governance contract for a future entity addition.
Distinct remedies / feasibility
Preferred — Flyway-only mutation, optional Hibernate validation
- make Flyway the only production schema-mutation authority;
- set Hibernate DDL behavior to
none or, only if entity-to-schema validation is actually useful and proven against the current non-JPA/JDBC architecture, validate;
- add a deterministic contract test rejecting
update, create, and create-drop in deployable profiles;
- preserve test-only isolated schema creation only where a test profile explicitly owns it and cannot reach production data;
- update migration/rollback/Architecture/TRD/Test Strategy documentation accordingly.
Alternative — remove unused JPA schema-generation configuration/dependency surface
If source inventory proves the ETL service does not use JPA entities at all, remove the unused JPA schema-generation configuration (and eventually unused JPA dependency if complete source/runtime verification supports it). This can reduce attack/configuration surface, but must not be mixed into the first authority repair unless dependency removal is independently verified.
Reject
- keeping
update because current mapped-entity count appears zero;
- allowing Hibernate to create missing tables while Flyway owns later migrations;
- adding broad
baseline-on-migrate=true to hide drift;
- weakening migration validation or using ORM mutation as rollback;
- choosing
validate without proving it is compatible with the JDBC-owned schema and does not create a false requirement for ORM mappings.
Current implementation classification
planned / known_gap. Before source mutation, recheck current active ETL application-config ownership and durable migration branches. The first TDD slice should be configuration-authority-only, not a broad JPA refactor.
Acceptance
- fail-first test proves protected deployable config currently permits Hibernate
update;
- production/deployable profiles cannot run Hibernate automatic schema mutation (
update, create, create-drop);
- Flyway remains the sole production schema-changing startup mechanism;
- every owned schema change continues to require versioned migration, migration test, rollout/rollback or forward-recovery evidence, and exact PostgreSQL rehearsal where material;
- tests prevent a future entity/config change from silently re-enabling runtime DDL mutation;
- clean bootstrap, existing-volume upgrade and active durable-job migrations remain compatible;
FLYWAY_BASELINE_ON_MIGRATE remains fail-closed by default and is not used to paper over unmanaged drift;
- canonical TRD/Architecture/ADR/Data Model/Test Strategy/Migration/Traceability identifies one schema authority and distinguishes bootstrap compatibility SQL from versioned service migrations;
- exact-source CI/security/non-vacuous coverage/review gates pass before protected integration.
Relationship: #150/#155 own legacy bootstrap retirement; #143–#148 own durable-job migration stack; #159 owns canonical architecture/data/migration traceability; #165 owns release/provenance.
Buyer / migration-safety gap
Protected
develop@622e5e6c3d534f230c390f10e3832efadfc01825enables both Flyway migration management and Hibernate automatic schema mutation in the deployable ETL service:The active durable-job work already depends on ordered, reviewed Flyway migrations and explicit rollback/forward-recovery evidence. A second runtime DDL authority (
ddl-auto: update) makes acquisition-grade schema provenance ambiguous even if it currently happens to find no mapped entity requiring a mutation.Spring Boot's maintained database-initialization guidance recommends a single mechanism for schema generation and states that when using a higher-level migration tool such as Flyway or Liquibase, it should be used alone to create/initialize the schema.
ddl-autovalues includenone,validate,update,create, andcreate-drop; non-embedded databases with a schema manager otherwise default tononewhen not explicitly overridden.Primary implementation reference to reverify at mutation time: Spring Boot
Database Initializationdocumentation (docs.spring.io/spring-boot/how-to/data-initialization.html).RCA
ddl-auto: updatewhile also enabling Flyway.@Entityproduction type, which can makeddl-auto:updateappear inert and allow the unsafe authority to persist unnoticed. Inert today is not a valid schema-governance contract for a future entity addition.Distinct remedies / feasibility
Preferred — Flyway-only mutation, optional Hibernate validation
noneor, only if entity-to-schema validation is actually useful and proven against the current non-JPA/JDBC architecture,validate;update,create, andcreate-dropin deployable profiles;Alternative — remove unused JPA schema-generation configuration/dependency surface
If source inventory proves the ETL service does not use JPA entities at all, remove the unused JPA schema-generation configuration (and eventually unused JPA dependency if complete source/runtime verification supports it). This can reduce attack/configuration surface, but must not be mixed into the first authority repair unless dependency removal is independently verified.
Reject
updatebecause current mapped-entity count appears zero;baseline-on-migrate=trueto hide drift;validatewithout proving it is compatible with the JDBC-owned schema and does not create a false requirement for ORM mappings.Current implementation classification
planned / known_gap. Before source mutation, recheck current active ETL application-config ownership and durable migration branches. The first TDD slice should be configuration-authority-only, not a broad JPA refactor.Acceptance
update;update,create,create-drop);FLYWAY_BASELINE_ON_MIGRATEremains fail-closed by default and is not used to paper over unmanaged drift;Relationship: #150/#155 own legacy bootstrap retirement; #143–#148 own durable-job migration stack; #159 owns canonical architecture/data/migration traceability; #165 owns release/provenance.