Drop tables order should be the reverse of create tables
Status: Beta
Brought to you by:
mguessan
PROBLEM:
Because of FK constraints, the DROP TABLE statements
should be in the *reverse* order of the CREATE TABLE
statements in the DDL. Currently, there are in the same
order.
SOLUTION:
In the generate() method of DDL.java, replace the
following code:
for ( i=0, size=tableList.size() ; i<size ; i++ ){
SQLTable table = (SQLTable)tableList.elementAt( i );
gen.drop( table, out );
}
With:
for ( i=tableList.size()-1 ; i>=0; i-- ){
SQLTable table = (SQLTable)tableList.elementAt( i );
gen.drop( table, out );
}
I have tested this fix with MS SQL Server 2000. Hsqldb
doesn't care either way.