【发布时间】:2017-01-02 08:36:12
【问题描述】:
我有以下变更集,使用 LiquiBase 3.5.1(最新):
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<databaseChangeLog
xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.5.xsd">
<preConditions onFail="MARK_RAN">
<sqlCheck expectedResult="2">SELECT COUNT(*) FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA = 'dbo';</sqlCheck>
</preConditions>
<changeSet author="user" id="base">
<sqlFile path="liquibase/base.sql"/>
</changeSet>
</databaseChangeLog>
看起来很简单,对吧?这个想法是它检查数据库是否为空(检查自动生成的 Liquibase 表的 2 个表),如果是,则运行基本脚本。但是,如果它失败了,它应该将变更集标记为运行并继续前进(功能here 的文档)。但是,我收到以下错误:
Value 'MARK_RAN' is not facet-valid with respect to enumeration '[HALT, WARN]'.
【问题讨论】:
-
查看我的答案here。简短回答:
MARK_RAN在更改日志级别上不可用。仅在变更集上。