Liquibase® version 3.8.5 is now available! Get it for free.
2018 XML Announcement
News All Previous Posts >>

Subscribe for email updates

- and/or -

Modifying Generated SQL

Although Liquibase supports most standard SQL statements with its change tags, there are times when the generated SQL needs to be slightly different for your particular needs. Examples include changing datatypes or adding additional vendor-specific clauses such as “ENGINE INNODB” to CREATE TABLE statements. Since 1.9


<changeSet id="1" author="nvoxland">
    <createTable tableName="person">
        <column name="id" type="bigint"/>
        <column name="firstname" type="varchar(255)"/>
        <column name="lastname" type="varchar(255)"/>
         <replace replace="bigint" with="long"/>
    <modifySql dbms="mysql">
         <append value=" engine innodb"/>

Available Attributes

dbmsThe type of a database which that changeSet is to be used for. When the migration step is running, it checks the database type against this attribute. Valid database type names are listed on the supported databases page. It is possible to list multiple databases separated by commas. You can also specify that a changeset is NOT applicable to a particular database type by prefixing with !. The keywords all and none are also available.
contextList of contexts in which to run the sql modification. If not specified, is applied in all contexts Since 2.0
applyToRollbackShould the sql modification be applied to rollback statements? Default='false' Since 2.0

Available Sub-Tags


Adds SQL to the beginning of the statement.

Available Attributes

valueText to add to beginning of statement


Adds SQL to the end of the statement.

Available Attributes

valueText to add to end of statement


Replaces all instances of the text specified.

Available Attributes

replaceText to replace
withText to replace with


Replaces all instances of the regular expression specified.

Available Attributes

replaceRegular expression specifying text to replace
withText to replace with