Set UniqueConstraint.clustered to false #204
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
In Issue #191, neivkovic reported unnecessery recreation of unique constraints. I believe this is due the liqubase-core setting the UniqueConstraint.clustered to true/false. Currently the liquibase-hibernate snapshot does not set UniqueConstraint.clustered at all resulting in a true/false != null, thus it appears the unqiue constraint has changed (See screenshot below).
I only did some light research on whether hibernate can support setting the cluster attribute on a unique constraint, but from what I say this is not possible so I think it is safe to set to false. There could be potential fallout if liquibase-core does not always set the UniqueConstraint.clustered to true/false. I am comparing against Postgresl, which does not support the attribute so I am pretty sure it will set it for other dbs as well.