{
StringWriter stringWriter = new StringWriter();
platform.getSqlBuilder().setWriter(stringWriter);
// use cglib enhanced wrapper for SqlBuilder to allow overriding ddlutils 1.0 behavior at runtime for
// https://issues.apache.org/jira/browse/DDLUTILS-75 which is fixed in ddlutils 1.1 but hasn't been released yet.
SqlBuilder sqlBuilder = new EnhancedSqlBuilder(platform.getSqlBuilder());
sqlBuilder.createTables(model, params, false);
int createSchemaLength = stringWriter.getBuffer().length();
writeOutput(new File(outputDir,"create-schema.sql"),stringWriter.toString());
stringWriter.getBuffer().setLength(0);
sqlBuilder.createTables(model, params, true);
stringWriter.getBuffer().setLength(stringWriter.getBuffer().length()-createSchemaLength);
writeOutput(new File(outputDir,"drop-schema.sql"), stringWriter.toString());
}
catch (IOException ioe)
{