Jira issue originally created by user @beberlei:
Currently drop schema infers from the current metadata model which tables have to be dropped.
However when your schema changes and you then want to regenerate the database the tables may have changed and SQL errors like "table does not exist" may occur.
Therefore I propose to extend dropSchema() to have four modes:
Comment created by @beberlei:
Because of Bug DDC-98 the orphans command is a bit dangerous as of now, but the rest will be implemented for now. There are other problems also with orphans.
This is a bit more complicated because of foreign key constraints.
The algorithm for "database" should work like the following:
Also force can be dropped by first retrieving a list of all the tables of a database and diff'ing the tables to be dropped.
Implemented a new mode "database" which drops all tables in the database, first the metadata tables based on commit order calculations, then the missing tables.
Additionally implemented a filter which deletes tables from the to drop list when they don't exist yet (which is relevant when metadata is changing alot).
Issue was closed with resolution "Fixed"