Although Liquibase tries to provide a wide range of database Change Types, there are times you may want to create your own custom Change Type class.

To create your own custom Change Type, simply create a class that implements the liquibase.change.custom.CustomSqlChange or liquibase.change.custom.CustomTaskChange interface <customChange> tag in your change set.

If your change can be rolled back, implement the liquibase.change.custom.CustomSqlRollback interface as well.

For a sample custom change class, see liquibase.change.custom.ExampleCustomSqlChange in the test folder

XML example

<changeSet  author="liquibase-docs"  id="customChange-example">  

YAML example

  id:  customChange-example  
  author:  liquibase-docs  
  -  customChange:  {}

JSON example

{  "changeSet":  {  "id":  "customChange-example",  "author":  "liquibase-docs",  "changes":  [  {  "customChange":  {  }  }]  }  }

Database support

Database Notes Auto rollback
DB2/LUW Supported No
DB2/z Supported No
Derby Supported No
Firebird Supported No
H2 Supported No
HyperSQL Supported No
INGRES Supported No
Informix Supported No
MariaDB Supported No
MySQL Supported No
Oracle Supported No
PostgreSQL Supported No
SQL Server Supported No
SQLite Supported No
Sybase Supported No
Sybase Anywhere Supported No