Is it possible to configure a different name for the DATABASECHANGELOG and DATABASECHANGELOGLOCK tables ?
I have a scenario where a couple of separate components need to manage their own sets of tables, and they need to do on their own. And yes, they have to access the same schema.
I use Oracle and manage Liquibase through Maven plugin.
Yes, you can. It looks for liquibase.databaseChangeLogTableName and liquibase.databaseChangeLogLockTableName system properties and will use those rather than the default if passed.Â
You can also specify your own Database implementation (how varies between 1.9 and 2.0) and override the getDatabaseChangeLogTableName() and getDatabaseChangeLogLockTableName() methods.
Well, create one changelog per application, and run liquibase for each application too, with - as said previously - the parameter -Dliquibase.databaseChangeLogTableName=anameforapp1 and -DgetDatabaseChangeLogLockTableName=anameforapp2.
Thanks Gavriel - your example was super helpful to get me going.
I hit this weird issue when attempting to configure liquibase control tables against an Oracle database (in first run control tables were created as expected, but on subsequent attempts to migrate the schema the control tables were attempted to be recreated resulting in errors).Â
Posting the solution I stumbled upon, it may be useful for someone (IMO its an oracle-specific issue):
Against Oracle Database:
The configured liquibase control table names SHOULD be specified in ALL CAPS for it to be consistently recognized across multiple liquibase runs (first time setup & subsequent attempts to migrate).Â
Against Postgres Database:
The configured liquibase control table names are not required to be in ALL CAPS, i.e., it works appropriately across multiple liquibase runs even when the table names are specified is in small case.
As Liquibase uses JDBC connectivity to perform its operations using the database-specific driver - I assume its safe to attribute this behavior to ojdbc7.jar (oracle driver I specified in the classpath when performing liquibase operations against Oracle database).
Can we please request a new feature to be able to configure not only via system settings. 2 disadvantages exist here:
It forces ITO to change a standard deployment workflow. Which is not good when there are a lot of clients. The solution must exist when we build our application.Â
When different applications are deployed and they share the same database, I would say it is impossible to control it via system setting. I cannot change it, deploy one application, change the settings again, deploy the next application.
I would offer to include this feature into the master changelog. It is the only file. It will be clear and quite flexible, I think. Probably settings should have higher priority, or, I would even throw an exception if it is configured both, via setting and via the master changelog. User must fix it first. We must be as explicit here as possible.
The updateSQL is a Liquibase command that allows you to inspect the SQL that would be executed by the update command, without actually executing it in your database target.