Auto-Increment vs. Sequences: Using Liquibase with Oracle AND MySQL

Hello everybody,

I am looking for a way to maintain a constantly evolving DB-schema for MySQL and Oracle.

Our MySQL-schema uses AUTO INCREMENTs to generate primary keys.
Our Oracle-schema uses SEQUENCES to generate primary keys.

I am unsure whether it is possible to implement these approaches in a single Liquibase-Schema


The best approach is to use changelog parameters and the dbms tag. 

At the top of your changeset you can include:
    <property name=“autoIncrement” value="false dbms=“oracle”/>

Then you can have changeSets like this:


Liquibase will not cause changesets that define columns as auto-increment where the database does not support it, but the above is probably safer and more readable.


Edit: Nathans idea works well for DDL statements. Currently I am stuck with CSV imports.


thank you very much. Your suggestion looks elegant - I like that - and I’ll test-balloon it by migrating a database from oracle to mysql and vice versa.