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

unnecessery recreation of unique constraints #191

Closed
ghost opened this issue Nov 15, 2018 · 5 comments
Closed

unnecessery recreation of unique constraints #191

ghost opened this issue Nov 15, 2018 · 5 comments

Comments

@ghost
Copy link

ghost commented Nov 15, 2018

Hi!

We use in our project liquibase-maven-plugin with the newest version, if we create a diff between our mariadb and the hibernate class files. Every unique constraint is dropped and added again.

Will be there in the next future improvements?

Here an example of the mentioned drop/create changeset:

<changeSet author="nemo (generated)" id="1542210363231-27">
      <dropUniqueConstraint constraintName="UKq61v8b5qvs3cxalvj88b9lcel" tableName="config"/>
      <addUniqueConstraint columnNames="host"
                           constraintName="UKq61v8b5qvs3cxalvj88b9lcel"
                           tableName="config"/>
</changeSet>

Our project settings:

<artifactId>spring-boot-starter-parent</artifactId>
<groupId>org.springframework.boot</groupId>
<version>2.0.3.RELEASE</version>
<liquibase.version>3.6.2</liquibase.version>
<liquibase-hibernate5.version>3.6</liquibase-hibernate5.version>

liquibase-maven-plugin:

<groupId>org.liquibase</groupId>
<artifactId>liquibase-maven-plugin</artifactId>
<version>3.6.2</version>
<groupId>org.liquibase.ext</groupId>
<artifactId>liquibase-hibernate5</artifactId>
<version>3.6</version>

Regards
Nenad

┆Issue is synchronized with this Jira Bug by Unito

@benoitheinrich
Copy link

Hey, I've got the exact same problem here and I actually just setup a github project that reproduce this problem.

If someone could have a look at it, thanks 👍

https://github.com/benoitheinrich/liquibase-hibernate-bug

@benoitheinrich
Copy link

Anyone interested by a fix I've published something that so far seems to work.

This is available at the repo indicated above.

This also fixes other issues with that plugin, so enjoy !!

@benoitheinrich
Copy link

btw this is probably a duplicate of #173

@ghost
Copy link

ghost commented Jun 1, 2019

@neivkovic, I ran into a similar issue with Postgres. After some research it appears the database snapshot had the cluster attribute set to false, but the Hibernate snapshot had it set to null. I updated the liquibase-hibernate logic to alway set the cluster attribute to false as I didn't see a way to set it to true from the hibernate configuration. This resolved my issue. I submitted the fix as PR #204.

@ernesto-castelan
Copy link

Your PR also fixes the issue for Oracle DB 12c. Thanks

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

No branches or pull requests

3 participants