One thing that we had to take care of is Oracle's "char semantic". In order to ensure that VARCHAR(30) is indeed created as VARCHAR(30 Char) in Oracle we put the following at the start of each changelog:
- <changeSet author="dba" id="char_semantics" dbms="oracle" runAlways="true">
<sql>alter session set nls_length_semantics = 'CHAR'</sql>
</changeSet>
Another thing that we do is to use properties e.g. to define columns for UUIDs:
<property name="uuid_function" value="uid.uuid_generate_v4()" dbms="postgresql"/>
<property name="uuid_function" value="NEWID()" dbms="mssql"/>
<property name="uuid_function" value="sys_guid()" dbms="oracle"/>
<property name="uuid_type" value="uuid" dbms="postgresql"/>
<property name="uuid_type" value="uniqueidentifier" dbms="mssql"/>
<property name="uuid_type" value="RAW(32)" dbms="oracle"/>
<changeSet author="arthur" id="1">
<createTable tableName="foo">
<column name="id" type="${uuid_type}" defaultValueComputed="${uuid_function}">
<constraints nullable="false" />
</column>
</createTable>
</changeSet>
The rules when Liquibase quotes object names are also not helpful. Consider e.g. the following:
<createTable tableName="FooBar">
For Oracle Liquibase does not quote the table name and creates a table named FOOBAR. For Postgres Liquibase quotes the table name and thus a table with a quoted identifier is created "FooBar". For SQL Server the name is also not quoted. We finally created our own implementation of PostgresDatabase that only quotes names if they contain special characters or if they are reserved words. If you are interested, I am willing to share this implementation. I have seen some questions on Stackoverflow regarding this as well, so we are not the only ones.
We wind up using "logicalFilePath" in all our changeLogs that only contains the filename, not the path and thus always uses the same value regardless of the environment. That however is error prone as it requires manual steps when creating new changelogs.
From my perspective, this (use the file name, not the full path) should be the default behavior of Liquibase.