我们使用的是LB 3.5。下面是主changelog
<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中,我们有以下changeSets:
<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生成SQL,而不为DDL生成。我试过"CONFIG or DDL",没有成功。
另一个问题是,如果我将changeSets中的'labels‘属性更改为'context',LB不会使用--context=“v13__00_03,CONFIG”生成任何内容。
是这些bug,还是我错过了什么?
发布于 2016-06-16 21:25:05
我能想到的唯一可能性是DDL更改已经被应用了。您的变更集标记为DDL as runOnChange=false,因此即使文件已更改,它也不会重新运行。
https://stackoverflow.com/questions/37855189
复制相似问题