With Liquibase XML you can trigger Java code to execute for a change with:
<customChange class="my.java.Class">
<param name="id" value="2" />
</customChange>
How can you trigger a custom change with Liquibase SQL Format?
TL;DR You can't.
The supported formats for defining a custom change set are:
<changeSet id="21" author="nvoxland">
<customChange class="liquibase.change.custom.ExampleCustomTaskChange">
<param name="helloTo" value="world"/>
</customChange>
</changeSet>
- changeSet:
id: 21
author: nvoxland
changes:
- customChange: {
"class": "liquibase.change.custom.ExampleCustomTaskChange",
"helloTo": "world" }
{
"changeSet": {
"id": "21",
"author": "nvoxland",
"changes": [
{
"customChange": {
"class": "liquibase.change.custom.ExampleCustomTaskChange",
"helloTo": "world"
}
}
]
}
}
Based on https://docs.liquibase.com/change-types/custom-change.html