我使用Liquibase 3.4.2(通過Maven插件)。我有一個db.changelog-master.xml文件,其中包含另外兩個文件:db.changelog-2.6.xml和db.changelog-2.10。使用回滾標籤changeSetId和changeSetAuthor時找不到Liquibase ChangeSet
的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
命令我結束了具有以下錯誤消息:
更改設置/數據庫遷移/版本/db.changelog-2.10.xml::1::my-user不存在
我做錯了什麼或這是一個Liquibase錯誤?