Joined: Thu Dec 20, 2007 7:44 am Posts: 5
|
I am using the hbm2ddl Ant task to generate DDL from a hibernate mapping file. I set the "drop" attribute to true so that it will generate drop statements if tables already exist. This works fine until one of my tables contains a foreign key constraint, at this point the generated DDL puts the drop foreign key constraint at the top of the DDL but doesn't check if the table already exists - this causes the DDL to fail the first time it is run against a clean DB which doesn't contain the tables. The generated DDL looks like so:
alter table track_metadata drop foreign key FKD6002AE1F90DF610;
drop table if exists track_metadata;
Is there no way the "alter table" statement can check for existence of the table before it tries to drop the foreign key?
I am using the 3.2.0 GA release of hibernate tools.
|
|