Liquibase SQL format. Statement and rollback example

Posted by Java developer blog on June 18, 2018

Statement and rollback example

1
2
3
4
5
6
7
8
--liquibase formatted sql

--changeset author:id
CREATE TABLE order (
...
);

--rollback drop table order;

Statement and rollback multiple line example

Liquibase will split the statements on every semicolon by default. In some cases it could lead to an error. To fix the error add “splitStatements:false rollbackSplitStatements:false” to a chageset.

1
2
3
--liquibase formatted sql

--changeset author:id splitStatements:false rollbackSplitStatements:false

Links:

https://www.liquibase.org

https://www.liquibase.org/documentation/sql_format.html

https://github.com/liquibase/liquibase/pull/334