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

use unique name for backing index of unique constraints #555

Merged
merged 3 commits into from
Nov 8, 2023

Conversation

chrstnbrn
Copy link

fixes #411 and maybe also #436

#385 introduced a change that set the name of the backing index of unique constraints to <TABLE_NAME>_IX. However, this causes issues when there is more than one unique constraint for a table. The unique constraint of columnA will be connected to the backing index of columnB. This will make the UniqueConstraintComparator.findDifferences method come to the conclusion, that the unique constraint changed even though it didn't. As a result the unique constraint will be dropped and recreated.

I fixed this by changing the backing index name to <UNIQUE_CONSTRAINT_NAME>_IX. It fixes the issue in the test case I modified, but I'm not sure if this could cause other problems.

@filipelautert
Copy link
Collaborator

Hi @chrstnbrn , thanks for the PR! Seems it would be applicable for Hibernate 6 too, right?

@chrstnbrn
Copy link
Author

Yes, I think so.

@filipelautert filipelautert merged commit 0b7b52e into liquibase:hibernate5 Nov 8, 2023
7 of 9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

None yet

2 participants