1
我有一個變更Liquibase先決條件未能自定義錯誤消息
<changeSet id="ABC123" author="davnicwil">
<preConditions onFail="HALT">
<sqlCheck expectedResult="3">SELECT count(*) FROM little_pigs</sqlCheck>
</preConditions>
<sql>DROP TABLE wolf</sql>
</changeSet>
當只有2行中little_pigs
時,出現此錯誤消息
liquibase.exception.MigrationFailedException:
Migration failed for change set migrations.xml::ABC123::davnicwil:
Reason:
migrations.xml : SQL Precondition failed. Expected '3' got '2'
我想一個更有意義的錯誤消息,如
liquibase.exception.MigrationFailedException:
Migration failed for change set migrations.xml::ABC123::davnicwil:
Reason:
3 little pigs are required to defeat the wolf
有沒有辦法t o如何配置像這樣的自定義錯誤消息,作爲前提條件?
靜態消息是好的。如果一個動態消息是可能的,那就更好了。
來實現你自己的邏輯謝謝,就是這樣!我不能相信我錯過了,我必須在提問之前閱讀過5次文檔頁面:-) – davnicwil