for (int i = 0; i < _schema.getTableCount(); i++) {
Table table = _schema.getTable(i);
if (genDrop) { table.toDropDDL(writer); }
if (genCreate) { table.toCreateDDL(writer); }
if (genPrimaryKey) { table.getPrimaryKey().toCreateDDL(writer); }
if (genForeignKey) { createForeignKeyDDL(table, writer); }
if (genIndex) { createIndex(table, writer); }
if (genKeyGen && (table.getKeyGenerator() != null)) {
table.getKeyGenerator().setTable(table);