Liquibase Utils is an extension to Liquibase to add common utilities like preconditions
<preConditions>
<utils:contextDefined/>
</preConditions>
<preConditions>
<utils:contextMatch expression="(a and b) or !c"/>
</preConditions>
- Liquibase Requirements: Requires Liquibase 3.8.0+
- Download the
liquibase-utils.jar
file from:- Direct: "release" section on github
- Maven:
- Group ID
com.github.evantill
- Artifact ID
liquibase-utils
- Version
0.2.0
- Group ID
In order to use this extension, you must have the liquibase-utils.jar
jar in your classpath.
For XML change logs, define the utils
namespace as below:
<?xml version="1.0" encoding="UTF-8"?>
<databaseChangeLog
xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:utils="http://www.liquibase.org/xml/ns/dbchangelog-ext/liquibase-utils"
xsi:schemaLocation= "http://www.liquibase.org/xml/ns/dbchangelog
http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.8.xsd
http://www.liquibase.org/xml/ns/dbchangelog-ext/liquibase-utils
https://evantill.github.io/liquibase-utils/liquibase-utils-0.2.xsd">
</databaseChangeLog>
Using the XML elements defined by this extension requires specifying the utils
namespace prefix on those elements. Here is a quick example of how to require a context:
<preConditions>
<utils:contextDefined/>
</preConditions>
Refer to the documentation for further information.