Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changeset generation broken since 4.28 #6148

Closed
1 of 2 tasks
Floppy012 opened this issue Jul 31, 2024 · 8 comments
Closed
1 of 2 tasks

Changeset generation broken since 4.28 #6148

Floppy012 opened this issue Jul 31, 2024 · 8 comments

Comments

@Floppy012
Copy link

Floppy012 commented Jul 31, 2024

Search first

  • 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!)
@keerthu27
Copy link

keerthu27 commented Aug 6, 2024

Facing same issue when upgrading to Liquibase 4.28. Its not creating changelog for new fields
Below are the effected libraries
org.liquibase:liquibase-core:4.28
org.liquibase.ext:liquibase-hibernate6:4,28

@lorenzbaier
Copy link

this issue is related to liquibase/liquibase-hibernate#708

it breaks because the Catalog type is filtered out now because HibernateDatabase does not support it, but previously has setDefault(true) on the Catalog anyway which does not work anymore because the SnapshotGenerator for it isn't called anymore

I don't know whether this must be fixed in liquibase or liquibase-hibernate but I do think supportsCatalog needs to be taken into a count at

public boolean equals(CatalogAndSchema catalogAndSchema, Database accordingTo) {
right now it only looks at the comparison database but not the reference...

@tati-qalified
Copy link
Contributor

Hi @Floppy012, @keerthu27 and @lorenzbaier, thank you all for reporting this issue.
Would any of you be willing to submit a PR to propose a fix? Our development team is available to answer any questions you might have.

Let me know!
Thank you,
Tatiana

@Guschtel
Copy link
Contributor

Guschtel commented Sep 17, 2024

I commented a workaround in liquibase/liquibase-hibernate#708 (comment)
Not sure about the implications though, maybe you @tati-qalified can comment on this?

@Guschtel
Copy link
Contributor

Guschtel commented Sep 20, 2024

I think this issue is only related to liquibase-hibernate. not liquibase itself. At least it can easily be fixed there.

@sruthiganesh-HC
Copy link

@tati-qalified Any update on this issue yet? This is a major blocker and we cannot downgrade due to recent bug fixes as well.

@Guschtel
Copy link
Contributor

@sruthiganesh-HC try the latest nightly build
See liquibase/liquibase-hibernate@cca484a that should fix this issue.

@filipelautert
Copy link
Collaborator

This has been fixed by liquibase/liquibase-hibernate#717, and will be released with Liquibase 4.30.0 later this month.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

8 participants