-
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
Add and drop unique key constraints are added for same key in one-to-many relationship table #244
Comments
Same issue here. It wasnt fix in 3.9. This is use to connect to oracle 12c but it keeps regenerating the index key. |
I'm seeing the same behavior for a composite primary key. When running a diff (with the gradle plugin), I get a notice that the primary key has changed:
I tried two things, but to no avail:
I also noticed that when generating an initial changelog (against an empty database), this composite primary key is created by marking the columns as such: - column:
constraints:
primaryKey: true
primaryKeyName: usersPK however the changes that are generated as a result of running |
So right after writing the above comment, I tried one last thing: Update liquibase and liquibase-hibernate to 4.0.0. And this totally solves this issue 🎉 Not sure if that's a change in liquibase itself or liquibase-hibernate, but what I noticed is that when generating the initial changes (see second part of my comment above), primary keys are no longer created by simply marking the columns as such, but with a separate changeset like so (changed here: liquibase/liquibase@8412fdb): - changeSet:
changes:
- addPrimaryKey:
columnNames: a_id, b_id, c_id
constraintName: usersPK
tableName: users And then this also made me realize that I was using liquibase 3.8.1 which is quite old. |
Hi - we have some fixes and workarounds on this answer. Please reopen the issue if it is not fixable by using any of them. |
I've two entities with one-to-many relationship defined as
Their change sets are generated along with a relationship table but when a diffChangeLog is applied it gets generated as follows.
Please note that the constraintName ("UK_1") is same in both cases. Didn't quite get the reasoning behind adding, dropping and then adding again the constraint with same name. This adds unnecessary entries in changelog file.
┆Issue is synchronized with this Jira Bug by Unito
The text was updated successfully, but these errors were encountered: