|
Hibernate 4.2.3 Final, Hsqldb 2.2.9.
SchemaUpdate is generating update scripts for unique keys that already exist. As an example, schema update generated an update for:
2013-07-24 15:42:12,892 DEBUG [main] org.hibernate.tool.hbm2ddl.SchemaUpdate - alter table Deal drop constraint UK_6rlxqfyjoaym7viwkrqo69kln 2013-07-24 15:42:12,896 DEBUG [main] org.hibernate.tool.hbm2ddl.SchemaUpdate - alter table Deal add constraint UK_6rlxqfyjoaym7viwkrqo69kln unique (dealCode_ID, dealVersion)
on a database that already had this constraint:
select constraint_name, constraint_type, table_name from INFORMATION_SCHEMA.TABLE_CONSTRAINTS WHERE table_schema='PUBLIC' AND CONSTRAINT_TYPE='UNIQUE' AND TABLE_NAME='DEAL';
UK_WH182YGREFKPJOOJP38ROU42 UNIQUE DEAL UK_6RLXQFYJOAYM7VIWKRQO69KLN UNIQUE DEAL
It seems to be limited to unique keys - FKs seem to work ok.
|