mysql - Composite Unique Index created on each deploy -


i'm using spring 3.2 hibernate 4.2.1.final , mysql 5.5.

each time reload webapp hibernate creates new composite unique index of entities.

for example in entity have:

@table(uniqueconstraints = { @uniqueconstraint(columnnames = { "field1", "field2" }) })

on each deploy have new unique index on 2 field.

is bug?

thank marco

you have give name of composite unique index key

eg:

@table(uniqueconstraints = { @uniqueconstraint(name="field1_field2_unique_key", columnnames = { "field1", "field2" }) }) 

here composite unique index key name : field1_field2_unique_key


Comments

Popular posts from this blog

user interface - Python attempting to create a simple gui, getting "AttributeError: 'MainMenu' object has no attribute 'intro_screen'" -

jquery - Common JavaScript snippet to share files on Google Drive, Dropbox, Box.net or SkyDrive -

Android Gson.fromJson error -