With hibernate.hbm2ddl.auto=create, an "if exists" on the alter table drop constraint will still give an error since the table doesn't exist either. And there's not a way to say "alter table Foo if exists drop constraint UK_foo if exists". Regardless, I'm adding the support since it might be useful in other contexts. As far as I know, H2 and Postgres 9 are the only databases that support it (correct me if I'm wrong). MySQL and HSQL were mentioned above, but they do not.
The most consistent route would be to use something like "drop table Foo cascade constraints" where supported. Following up with HHH-8330.
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
With hibernate.hbm2ddl.auto=create, an "if exists" on the alter table drop constraint will still give an error since the table doesn't exist either. And there's not a way to say "alter table Foo if exists drop constraint UK_foo if exists". Regardless, I'm adding the support since it might be useful in other contexts. As far as I know, H2 and Postgres 9 are the only databases that support it (correct me if I'm wrong). MySQL and HSQL were mentioned above, but they do not.
The most consistent route would be to use something like "drop table Foo cascade constraints" where supported. Following up with HHH-8330.