Skip to content

Instantly share code, notes, and snippets.

@jahe
Last active August 29, 2015 14:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jahe/a23ce92f759e3c7b820e to your computer and use it in GitHub Desktop.
Save jahe/a23ce92f759e3c7b820e to your computer and use it in GitHub Desktop.
Liquibase Cheatsheet
// 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