Add db-migrations-flyway-liquibase: Flyway vs Liquibase migrations, rollbacks and baselines on Spring Boot 4.1

Companion code for the Flyway vs Liquibase article: checksum validation, out-of-order
and repeatable migrations, baselining an existing schema, Flyway Community's undo/diff/deploy
stubs, concurrent-startup locking for both tools, Liquibase changeset identity and rollback
(auto-generated vs explicit), a verified Liquibase 5.0.3 filename-caching defect, the new
OSS license service, the FSL license change, and running both tools against one database.

Co-Authored-By: Claude Sonnet 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Q6XdRjtsp4862EM44T7i9a
This commit is contained in:
2026-09-15 07:08:57 +00:00
co-authored by Claude Sonnet 5
parent b02fbe1416
commit 3908331431
61 changed files with 3128 additions and 0 deletions
@@ -0,0 +1,47 @@
spring:
application:
name: db-migrations-flyway-liquibase
datasource:
url: jdbc:h2:file:./data/quickstart;AUTO_SERVER=TRUE
username: sa
password: ""
flyway:
enabled: true
liquibase:
enabled: false
change-log: classpath:db/changelog/db.changelog-master.yaml
management:
endpoints:
web:
exposure:
include: flyway,liquibase,health
---
# ./scripts/run.sh both-naive — both tools enabled against the same fresh database, no other
# configuration. Fails to start: Liquibase's SpringLiquibase bean runs before Flyway's, so by the
# time Flyway checks the schema it finds tables it doesn't recognize. See docs/14-running-both-at-once.md.
spring:
config:
activate:
on-profile: both-naive
datasource:
url: jdbc:h2:file:./data/both-naive;AUTO_SERVER=TRUE
liquibase:
enabled: true
---
# ./scripts/run.sh both-fixed — the fix from docs/14-running-both-at-once.md applied: Flyway is
# told to baseline the schema Liquibase already built, starting from "nothing has run yet"
# (baseline-version: 0) rather than the default "version 1 already ran" baseline.
spring:
config:
activate:
on-profile: both-fixed
datasource:
url: jdbc:h2:file:./data/both-fixed;AUTO_SERVER=TRUE
liquibase:
enabled: true
flyway:
baseline-on-migrate: true
baseline-version: 0