我们使用的是 liquibase 1.9.5,但我还没有将其视为该版本的已知错误。简短的故事是我们成功地为我们的 1.0 版本运行了 liquibase,但是在尝试运行具有额外变更集的 1.1 版本时,它错误地抱怨 1.0 变更集的 md5sums。
我们已经在短期内通过将 DATABASECHANGELOG 中的 md5sum 列清零来解决它,但我想知道我是否只是做错了什么。
我们按如下方式组织我们的 liquibase:我们在每次部署时运行一个主 .xml 文件,该文件仅包含针对我们软件的每个版本的单独文件的命令(以正确的顺序)
<databaseChangeLog xmlns="http://www.liquibase.org/xml/ns/dbchangelog/1.9"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog/1.9 http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-1.9.xsd">
<include file="v1_0.xml" />
<include file="v1_1.xml" />
</databaseChangeLog>
所以第一个版本只包含v1_0.xml,而我们刚刚推出的版本包含了我们上面的内容。
v1_0.xml 文件在不同版本之间没有变化,但在尝试为新版本调用 liquibase 时出现以下错误:
SEVERE: Validation Failed:
1 change sets check sum
v1_0.xml::foo_schema::bdeacon::(MD5Sum: ff63b8d1739e6cf1dcaed6a0ef585257)
有问题的变更集:
<changeSet author="bdeacon" id="foo_schema">
<preConditions onFail="MARK_RAN">
<not><tableExists tableName="some_table"/></not>
</preConditions>
<sqlFile path="database/initial/foo-schema.sql" />
</changeSet>
引用的 foo-schema.sql 文件在版本之间也没有变化。(它为我们完成了整个数据库模式的初始创建,然后包括前提条件中提到的“some_table”。)
我希望 liquibase 不希望我们手动将 validCheckSum 元素添加到版本之间的每个 changeSet ...