fahadzk opened a new issue, #7236:
URL: https://github.com/apache/incubator-kie/issues/7236

   **Versions:**  Kogito 10.2.0, Quarkus 3.18.2, PostgreSQL 14, 
kie-addons-quarkus-persistence-jdbc
   **Scenario:**  An app on Kogito 10.0.0 created its tables through Quarkus 
Flyway from db/postgresql/V1.35.0…V10.0.1, all recorded in 
flyway_schema_history. After upgrading to 10.2.0:
   
   1. With kie.flyway.enabled=false (the default), 
V10.0.2__create_event_table.sql never runs, and process start fails with 
relation "event_types" does not exist in GenericRepository.insertInternal.
   2. With kie.flyway.enabled=true, KIE Flyway creates 
kie_flyway_history_runtime_persistence with a baseline of 0.0 and reruns 
V1.35.0. Startup fails with relation "process_instances" already exists.
   
   
   _**Cause**: KieFlywayInitializer hardcodes baselineOnMigrate(true) and 
baselineVersion("0.0"). KieFlywayQuarkusRuntimeConfig only exposes enabled and 
modules.<name>.enabled._
   
   **Request:** Add a per-module baseline setting (for example 
kie.flyway.modules."runtime-persistence".baseline-version), or detect existing 
tables, and document the 10.0 → 10.1+ upgrade path
   
   
   **EDIT : Workaround:** 
   Build your workflow with these changes in _application.properties_, keep KIE 
Flyway off and let Quarkus Flyway run the relocated scripts:
   
   kie.flyway.enabled=false
   quarkus.flyway.migrate-at-start=true
   
quarkus.flyway.locations=db/migration,kie-flyway/db/persistence-jdbc/postgresql 
   
   > Kogito 10.1+ moved its JDBC persistence scripts from db/postgresql to 
kie-flyway/db/persistence-jdbc/postgresql, which only KIE Flyway 
(kie.flyway.enabled) reads. KIE Flyway keeps its own history table 
(kie_flyway_history_runtime_persistence) with a hardcoded 0.0 baseline, so on a 
DB created by Kogito <= 10.0 it reruns V1.35.0 and fails ("process_instances 
already exists"). 
   > Let Quarkus Flyway run those scripts instead: V1.35.0-V10.0.1 are 
byte-identical to 10.0, so their checksums match flyway_schema_history and only 
new ones (e.g. V10.0.2 event_types) are applied. Keep kie.flyway.enabled=false.
   
   
   Build-time property: cannot be overridden with an env var. Revisit when 
upstream allows a KIE Flyway baseline.
   
   V1.35.0–V10.0.1 in 10.2.0 are byte-identical to 10.0.0, so their checksums 
match the existing flyway_schema_history rows and only V10.0.2 is applied. If 
repair-at-start already marked the old versions as DELETE in 
flyway_schema_history, remove those marker rows first. Otherwise Flyway reruns 
V1.35.0.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to