I’m upgrading an old app from liquibase 3.5.5 to 4.1.
It includes a section that uses liquibase to generate a diff based upon the Hibernate Entities and the MySql database.
For some reason, the changesets being created by the Diff don’t include an “index name” for Unique Indexes.
if I add the following to my Entity:
@javax.persistence.Index(name = "Peter2ItemIdx", columnList = "name, itemId", unique=true)
It generates a changeset like this:
<changeSet author="pstiles (generated)" id="1602173067371-1">
<createIndex tableName="Item" unique="true">
<column name="name"/>
<column name="ItemId"/>
</createIndex>
</changeSet>
Obviously missing an “index name” property of any sort.
If I remove the “unique=true” then the generated changeset is better:
<changeSet author="pstiles (generated)" id="1602231213650-1">
<createIndex indexName="Peter2ItemIdx" tableName="Item">
<column name="name"/>
<column name="ItemId"/>
</createIndex>
</changeSet>
I’ve tried with 4.0 and 4.1 and appear to get the same results.
Any suggestions would be appreciated.