Grails 2.3 and Hibernate4: unique constraint name collision

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Grails 2.3 and Hibernate4: unique constraint name collision

Vahid Pazirandeh
Ever since upgrading my Grails app to Hibernate4 I am getting errors related to creating many of my unique constraints on startup, using both H2 and Postgres. For example:

ERROR hbm2ddl.SchemaExport  - HHH000389: Unsuccessful: alter table bravo add constraint unique_name  unique (bravo_prop, name)
ERROR hbm2ddl.SchemaExport  - ERROR: relation "unique_name" already exists

Please see details of this issue at SO: http://stackoverflow.com/questions/24793151/grails-2-3-and-hibernate4-unique-constraint-name-collision

Questions:
1. Is this a user error or is it a bug in one of the plugins/frameworks?
2. If a bug, is there a workaround? For example, is there a way to specify the name I want used for the constraint so that I can ensure collisions don't occur? I'm not looking forward to changing the names of all my domain properties to make them all unique... :)

Thanks!