return;
}
//Create a DDL generator
SpiEbeanServer serv = (SpiEbeanServer) ebeanServer;
DdlGenerator gen = serv.getDdlGenerator();
//Fire "before drop" event
try {
beforeDropDatabase();
} catch (Exception ex) {
//If the database exists, dropping has to be canceled to prevent data-loss
if (databaseExists) {
throw new RuntimeException("An unexpected exception occured", ex);
}
}
//Generate a DropDDL-script
gen.runScript(true, gen.generateDropDdl());
//If SQLite is being used, the database has to reloaded to release all resources
if (usingSQLite) {
loadDatabase();
}
//Generate a CreateDDL-script
if (usingSQLite) {
//If SQLite is being used, the CreateDLL-script has to be validated and potentially fixed to be valid
gen.runScript(false, validateCreateDDLSqlite(gen.generateCreateDdl()));
} else {
gen.runScript(false, gen.generateCreateDdl());
}
//Fire "after create" event
try {
afterCreateDatabase();