For CI/CD on non production environments I use the liquibase update command to continuously update databases. For production I would like to be able to generate the SQL required to migrate the database, so that I can review the changes before actually applying them. So there I use the updateSQL command.
However, when defining multi statement sql changes, to define for example a trigger the generated SQL file is not valid for MySQL / MariaDB. The Delimiter statements are missing.
I found a pull request, that looks like it will fix this issue. The pull request is from 2015 so I guess it will not be merged soon.
Given the following changelog:
Running the update command using the MariaDB driver against an empty database works flawlessly:
Running the updateSQL command using the MariaDB driver against an empty database:
Generates this SQL:
Applying this SQL against an empty database using the MariaDB mysql client fails:
This is because of the multi statement trigger. The delimiter is not set to `//` in the generated SQL.
Actual generated trigger:
I expect the generated trigger to look like:
MySQL / MariaDB