I have a changeset
<changeSet id="ABC123" author="davnicwil">
<preConditions onFail="HALT">
<sqlCheck expectedResult="3">SELECT count(*) FROM little_pigs</sqlCheck>
</preConditions>
<sql>DROP TABLE wolf</sql>
</changeSet>
When there are only 2 rows in little_pigs
, it fails with this error message
liquibase.exception.MigrationFailedException:
Migration failed for change set migrations.xml::ABC123::davnicwil:
Reason:
migrations.xml : SQL Precondition failed. Expected '3' got '2'
I'd like a more meaningful error message, such as
liquibase.exception.MigrationFailedException:
Migration failed for change set migrations.xml::ABC123::davnicwil:
Reason:
3 little pigs are required to defeat the wolf
Is there any way to configure a custom error message like this, for the preconditions?
A static message is fine. If a dynamic message is possible, all the better.