Open Guschtel opened 2 hours ago
@filipelautert following up our conversation in https://github.com/liquibase/liquibase-hibernate/issues/436#issuecomment-2082901657 the linked PR solves the remaining issues that we were having when creating a diff between the existing Schema in an Oracle Database and the JPA Entities in our project.
Thank you for your work in that pr, without it I would probably not have been able to find and solve the issue.
Environment
Liquibase Version: 4.29.2
Liquibase Integration & Version: Gradle
Liquibase Extension(s) & Version: org.liquibase.ext:liquibase-hibernate6:4.29.2
Database Vendor & Version: Oracle / H2
Operating System Type & Version: Windows
Infrastructure Type/Provider: local desktop
Description
When creating a liquibase changelog between JPA Entities and an Oracle database, the generated diff-changelog contains changeset entries that drop existing unique indexes and primary keys and recreates them the exact same way, even though there should be no such changes.
Steps To Reproduce
Create a JPA Entity with the corresponding annotations, for example:
Then run the diff command and see that the changes contains a lot of differences, of which only some are expected, for example:
Then run the diff-changelog command and no changesets are generated at all. This is fixed in https://github.com/liquibase/liquibase-hibernate/pull/717
When applying this fix, run the diff-changelog and then you will get diff-changelog changesets that contain unnecessary alter table statements similar to the following examples:
and
(The examples given here are from different runs)
Expected/Desired Behavior
No unnecessary alter table statements are created
Additional Context
Related issues: