【发布时间】:2016-05-13 22:07:18
【问题描述】:
我正在使用 Liquibase 3.4.2(通过 Maven 插件)。我有一个 db.changelog-master.xml 文件,其中包含另外两个文件:db.changelog-2.6.xml 和 db.changelog-2.10 >.
db.changelog-master.xml 看起来像这样:
<?xml version="1.0" encoding="UTF-8"?>
<databaseChangeLog logicalFilePath="/database-migration/db.changelog-master.xml"
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.4.xsd">
<include file="versions/db.changelog-2.6.xml" relativeToChangelogFile="true"/>
<include file="versions/db.changelog-2.10.xml" relativeToChangelogFile="true"/>
</databaseChangeLog>
在db.changelog-2.10中,我创建了一个<changeSet> 来删除一些数据,并且在<rollback> 标记中我引用了创建相同数据的<changeSet>。两个<changeSet> 看起来像这样:
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<databaseChangeLog logicalFilePath="/database-migration/versions/db.changelog-2.10.xml"
xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
xmlns:ext="http://www.liquibase.org/xml/ns/dbchangelog-ext"
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.4.xsd">
<changeSet id="1" author="my-user">
<insert tableName="TABLE">
<!-- SOME DATA -->
</insert>
</changeSet>
<changeSet id="2" author="my-user">
<delete tableName="TABLE" />
<rollback changeSetId="1" changeSetAuthor="my-user" />
</changeSet>
</databaseChangeLog>
问题是,当我尝试运行 update 命令时,我最终收到以下错误消息:
变更集 /database-migration/versions/db.changelog-2.10.xml::1::my-user 不存在
是我做错了什么还是这是一个 Liquibase 错误?
【问题讨论】:
标签: liquibase