liquibase
liquibase copied to clipboard
Changeset generation broken since 4.28
Search first
- [X] I searched and no similar issues were found
Description
Since liquibase 4.28 it seems like that changes are still detected but don't make it to the changeset when using the liquibase:diff
goal of the maven plugin. This only seems to be the case for when stuff is inserted into the database. When I ran the command on my personal project it did create a changeset containing only drop statements but no create/alter statements.
Steps To Reproduce
See this minimal reproduction repository: https://github.com/floppy012-repros/liquibase
- Clone the repo
- Start the test database
docker compose up -d
-
src/resources/db/migrations
is empty - Run
mvn clean compile liquibase:diff
- Observe log output contains the table and column but also states "No changesets to add to the changelog output."
[INFO] Found table test
[INFO] Found table test
[INFO] Found table test
[INFO] Found primary key testPK
[INFO] Found column id bigint
[INFO] Creating snapshot
[INFO] Diff command completed
[INFO] BEST PRACTICE: The changelog generated by diffChangeLog/generateChangeLog should be inspected for correctness and completeness before being deployed. Some database objects and their dependencies cannot be represented automatically, and they may need to be manually updated before being deployed.
[INFO] changeSets count: 0
[INFO] No changesets to add to the changelog output.
- Open
pom.xml
and setliquibase.version
property to4.27.0
- Run
mvn clean compile liquibase:diff
- Observe log output contains the table and column and now also creates the changelog file
[INFO] Creating snapshot
[INFO] Found table test
[INFO] Found table test
[INFO] Found table test
[INFO] Found primary key testPK
[INFO] Found column id bigint
[INFO] Creating snapshot
[INFO] Diff command completed
[INFO] BEST PRACTICE: The changelog generated by diffChangeLog/generateChangeLog should be inspected for correctness and completeness before being deployed. Some database objects and their dependencies cannot be represented automatically, and they may need to be manually updated before being deployed.
[INFO] changeSets count: 1
[INFO] src/main/resources/db/migrations/test.xml does not exist, creating and adding 1 changesets.
- Observe the created changelog file in
src/main/resources/db/migrations/test.xml
- Tear down the test database
docker compose down -v
Expected/Desired Behavior
Liquibase 4.28 and onwards should create a changelog file like 4.27 did.
Liquibase Version
4.28, 4.29
Database Vendor & Version
PostgreSQL 16.3.0
Liquibase Integration
maven
Liquibase Extensions
liquibase-hibernate6
OS and/or Infrastructure Type/Provider
Ubuntu 22.04 LTS
Additional Context
Apache Maven 3.9.6 (bc0240f3c744dd6b6ec2920b3cd08dcc295161ae) Maven home: /opt/applications/maven Java version: 21.0.3, vendor: Ubuntu, runtime: /usr/lib/jvm/java-21-openjdk-amd64 Default locale: en_US, platform encoding: UTF-8 OS name: "linux", version: "5.15.0-112-generic", arch: "amd64", family: "unix"
Are you willing to submit a PR?
- [ ] I'm willing to submit a PR (Thank you!)