【发布时间】:2016-06-16 09:30:52
【问题描述】:
我们使用的是 LB 3.5。以下是主变更日志
<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">
<!-- v13.0.00 -->
<include context="v13_0_00_03" file="changelog-v13.0.00.03.xml" relativeToChangelogFile="true"/>
<include context="v13_0_00_04" file="changelog-v13.0.00.04.xml" relativeToChangelogFile="true"/>
</databaseChangeLog>
现在在 changelog-v13.0.00.03.xml 我们有这些变更集:
<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">
<changeSet id="CT-39_1" author="auth1" failOnError="false" runOnChange="false" labels="DDL">
<sqlFile encoding="utf8" endDelimiter="\nGO" path="../scripts/ddl/ddl.sql" relativeToChangelogFile="true" />
</changeSet>
<changeSet id="CT-2" author="auth2" runOnChange="false" labels="TRIGPROC">
<preConditions onFail="CONTINUE">
<changeSetExecuted id="CT-39_1" author="auth1" />
</preConditions>
<sqlFile encoding="utf8" endDelimiter="\nGO" path="../scripts/trigprocs/sp_ins1.sql" relativeToChangelogFile="true"/>
</changeSet>
<changeSet id="CT-18" author="auth3" runOnChange="false" labels="TRIGPROC">
<sqlFile encoding="utf8" endDelimiter="\nGO" path="../scripts/trigprocs/sp_ins2.sql"
relativeToChangelogFile="true"/>
</changeSet>
<changeSet id="CT-2228" author="auth4" runOnChange="false" labels="CONFIG">
<sqlFile encoding="utf8" endDelimiter="\nGO" path="../scripts/config/insert_rec.sql" relativeToChangelogFile="true"/>
</changeSet>
以下命令可以正常工作,因为我希望看到 v13.0.00.03 的 SQL 文件并标记为 CONFIG:
liquibase --contexts=v13_0_00_03 --labels=CONFIG updateSQL
但是这个命令不起作用
liquibase --contexts=v13_0_00_03 --labels="CONFIG, DDL" updateSQL
它只为 CONFIG 而不是 DDL 生成 SQL。我尝试了“CONFIG 或 DDL”,但没有成功。
另一个问题是,如果我将 changeSets 中的 'labels' 属性更改为 'context',LB 不会使用 --contexts="v13_0_00_03, CONFIG" 生成任何内容。
是这些错误还是我在这里遗漏了什么?
【问题讨论】:
标签: liquibase