Last active
August 29, 2015 14:23
-
-
Save jahe/a23ce92f759e3c7b820e to your computer and use it in GitHub Desktop.
Liquibase Cheatsheet
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Precondition to execute a changelog | |
<preConditions onFail="MARK_RAN"> | |
<changeSetExecuted id="1" author="peter" changeLogFile="details/dbchangelog-01.00.00.00.xml"/> | |
<columnExists tableName="user" columnName="username" /> | |
</preConditions> | |
// Precondition to execute a changelog when the specific changelog hasn't been executed yet | |
<preConditions onFail="MARK_RAN"> | |
<not> | |
<changeSetExecuted id="1" author="peter" changeLogFile="details/dbchangelog-01.00.00.00.xml"/> | |
<columnExists tableName="user" columnName="username" /> | |
</not> | |
</preConditions> | |
// Drop Column "username" from table "user" | |
<changeSet author="peter" id="2"> | |
<dropColumn | |
columnName="username" | |
tableName="user" /> | |
</changeSet> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment