Skip to content

Commit

Permalink
Backport of PR #480 to hibernate5 (#613)
Browse files Browse the repository at this point in the history
  • Loading branch information
filipelautert authored Nov 3, 2023
1 parent 25e7ff9 commit a3d52c1
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import liquibase.structure.core.Index;
import liquibase.structure.core.Table;
import liquibase.structure.core.UniqueConstraint;
import liquibase.util.StringUtil;
import org.hibernate.HibernateException;

import java.math.BigInteger;
Expand Down Expand Up @@ -116,7 +117,7 @@ protected Index getBackingIndex(UniqueConstraint uniqueConstraint, org.hibernate
index.setRelation(uniqueConstraint.getRelation());
index.setColumns(uniqueConstraint.getColumns());
index.setUnique(true);
index.setName(hibernateTable.getName() + "_IX");
index.setName(String.format("%s_%s_IX",hibernateTable.getName(), StringUtil.randomIdentifer(4)));

return index;
}
Expand Down

0 comments on commit a3d52c1

Please sign in to comment.