Closed jeroenvs closed 9 years ago
Another option would be to provide access to the Liquibase Database instance. Allowing us to do:
if(database.typeName == "hsqldb") { sql(x); } else { sql(y); }
Liquibase itself has support for this sort of thing. It is a property that can be included in a changeset, named dbms
, which the DSL also supports.
Allow specific sections of a change log to be used for only one type of RDBMS. This would allow us to do things such as:
changeSet() { createTable(tableName: "address") { column(autoIncrement: true, name: "id", type: "BIGINT") { constraints(nullable: false, primaryKey: true) } } rdbms('hsqldb') { sql('x') } other { sql('y') } // do something else }
So, the following change sets would be semantically equal:
changeSet(rdbms: 'mysql') { ... }
changeSet() { rdbms('mysql') { ... } }