liquibase icon indicating copy to clipboard operation
liquibase copied to clipboard

Changeset generation broken since 4.28

Open Floppy012 opened this issue 6 months ago • 3 comments

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

  1. Clone the repo
  2. Start the test database docker compose up -d
  3. src/resources/db/migrations is empty
  4. Run mvn clean compile liquibase:diff
  5. 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.
  1. Open pom.xml and set liquibase.version property to 4.27.0
  2. Run mvn clean compile liquibase:diff
  3. 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.
  1. Observe the created changelog file in src/main/resources/db/migrations/test.xml
  2. 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!)

Floppy012 avatar Jul 31 '24 01:07 Floppy012