Liquibase 4.25: Rollback SQL for MySQL 8.0 FK Still Incomplete
0 reputation · 25 Apr 2025, 07:11 UTC
Testing Migrations Without Exposing Production Credentials
The goal is to validate Liquibase changesets in a sandbox while avoiding any use of live production credentials. Liquibase 4.25 introduces the rollbackSQL command, which outputs the exact SQL needed to revert a changeset. By pointing Liquibase at an in‑memory H2 database or a Docker‑based MySQL 8.0 instance, the rollback script can be inspected before any real data is touched.
Unresolved Foreign‑Key Rollback Issue
In MySQL 8.0, the generated rollback SQL may omit DROP CONSTRAINT statements for foreign keys, a behavior marked as “work in progress”. This omission can cause a rollback to fail when the target database enforces referential integrity.
Key questions remain:
1) Does Liquibase 4.25 reliably produce the necessary DROP CONSTRAINT statements for MySQL 8.0 foreign keys?
2) What is the recommended strategy to validate rollback SQL in a non‑production environment?
3) Is there a planned release or flag to enable full foreign‑key rollback support?