DbSupport dbSupport = DbSupportFactory.createDbSupport(connection, false);
if (dbSupport.getCurrentSchema().getTable(tmpFlywayTable).exists()) {
dbSupport.getJdbcTemplate().executeStatement("DROP TABLE " + tmpFlywayTable);
}
String sql = "CREATE TABLE " + tmpFlywayTable + " AS SELECT * FROM " + flyway.getTable() +
" WHERE " + dbSupport.quote("type") + "='CUSTOM'";
connection.prepareCall(sql).execute();
sql = "DELETE FROM " + flyway.getTable()
+ " WHERE " + dbSupport.quote("type") + "='CUSTOM'";
connection.prepareCall(sql).execute();