We manage changelogs that are targeted against Oracle and Postgres and sometimes SQL Server.
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:
The rules when Liquibase quotes object names are also not helpful. Consider e.g. the following:
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.
Not really a DBMS topic, but: we run changelogs from the commandline and through Maven alike (depending on the developer and the environment). In that case the “current directory” is different which means that Liquibase will put a different value into the column “filename” of the databasechangelog table. Which in turn means that a second run of the changelog in a different environment will fail because the filename is part of the primary key of that table and Liquibase doesn’t consider the changeSets as executed.
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.