You could use jOOQ s parsing connection, which wraps your target JDBC connection and is capable of translating your input DDL to any target dialect (if it s not too fancy and vendor specific). Flyway wouldn t be aware of this translating JDBC proxy, and wouldn t have to be. The online version of the SQL translator can be seen here. For example, if your input SQL is a MySQL specific:
create table t (i int primary key auto_increment);
The output could be:
-- Oracle
create table T (
I number(10) generated by default as identity(start with 1) not null,
primary key (I)
);
-- SQL Server
create table T (
I int identity(1, 1) not null,
primary key (I)
)
-- PostgreSQL
create table T (
I int generated by default as identity not null,
primary key (I)
)
-- PostgreSQL 9.4
create table T (
I serial4 not null,
primary key (I)
)
Disclaimer: I work for the company behind jOOQ.