-
Notifications
You must be signed in to change notification settings - Fork 158
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
diffChangeLog constantly creating and dropping indicies/primary keys since Spring Boot 3/Liquibase 4.19 #456
Comments
I have a similar issue while still using Spring Boot 2.7.8, after upgrading from My changelog instead of being empty as of v4.10.0 now contains changes like this:
While investigating I've looked at diff of v4.10.0 vs v4.11.0 there are only three files changes using these two commits: And there's hibernate-core update from Any ideas @nvoxland? |
Related to #436 |
This problem is fixed with version 4.21.0 //Update: Only the problem with "alter table" was fixed. the problem with primary keys / indices still exists in 4.21.0 |
Thanks a lot ! |
It wasn't in my case 🤷♂️ I still get
<changeSet author="george (generated)" id="1674498709369-1">
<dropUniqueConstraint constraintName="UC_APPLICATION_PRINCIPALID_COL" tableName="...">
</changeSet>
<changeSet author="george (generated)" id="1674498709369-2">
<addUniqueConstraint columnNames="id" constraintName="UC_APPLICATION_PRINCIPALID_COL" tableName="..."/>
</changeSet>
... |
You are right. Sorry. I mixed it up with another bug. The problem you described was fixed today: Hopefully it will be released soon |
Thanks for the hints. Yeah, I certainly hope so. They have also introduced a breaking change somewhere along the line with CommandResults results = new CommandScope("diffChangelog").addArgumentValue(DiffChangelogCommandStep.CHANGELOG_FILE_ARG, outputFile)
.addArgumentValue(DiffChangelogCommandStep.URL_ARG, URL)
.addArgumentValue(DiffChangelogCommandStep.USERNAME_ARG, USERNAME)
.addArgumentValue(DiffChangelogCommandStep.PASSWORD_ARG, PASSWORD)
.addArgumentValue(DiffChangelogCommandStep.REFERENCE_URL_ARG, REFERENCE_URL)
.addArgumentValue(DiffChangelogCommandStep.EXCLUDE_OBJECTS_ARG, EXCLUDED_OBJECTS)
.execute(); This will not work any more as they've removed a lot of static variables from the CommandResults results = new CommandScope(DiffChangelogCommandStep.COMMAND_NAME)
.addArgumentValue(DiffChangelogCommandStep.CHANGELOG_FILE_ARG, outputFile)
.addArgumentValue(PreCompareCommandStep.EXCLUDE_OBJECTS_ARG, EXCLUDED_OBJECTS)
.addArgumentValue(GenerateChangelogCommandStep.REFERENCE_URL_ARG, REFERENCE_URL)
.addArgumentValue(DbUrlConnectionCommandStep.URL_ARG, URL)
.addArgumentValue(DbUrlConnectionCommandStep.USERNAME_ARG, USERNAME)
.addArgumentValue(DbUrlConnectionCommandStep.PASSWORD_ARG, PASSWORD)
.execute(); Notice usages of The changes have been made here(6be41a8) but I have no idea what was the reason to refactor it or what's the new way of doing the same as I couldn't find any documentation related to it. |
Since upgrading to Spring Boot 3 (and thus to Liquibase 4.19), running diffChangeLog using
hibernate:spring:*
as a reference, Liquibase generates changelogs first dropping a constraint and then re-creates it with the same columns right after the drop-statement:A similar thing happens to Envers audit-tables, just with the primary key in that case:
When executing either of these combined change-set, on the next run of diffChangeLog, the same changesets are generated again.
Another thing is that for the same Envers audit-tables, first an
createIndex
-changeset is being created. After executing these and running diffChangeLog again, adropIndex
-changesets for the just created indices are being created.From what I can see, these changesets are only created for ManyToMany-relations and ElementCollection-annotated lists.
The text was updated successfully, but these errors were encountered: