1
votes

We are using LB 3.5. Below is the master 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>

Now in changelog-v13.0.00.03.xml we have these 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>

The following command works fine as I expect to see SQL file of v13.0.00.03 and labeled as CONFIG:

liquibase --contexts=v13_0_00_03  --labels=CONFIG updateSQL

But this command won't work

liquibase --contexts=v13_0_00_03  --labels="CONFIG, DDL" updateSQL

It only generates SQL for CONFIG and not DDL. I tried "CONFIG or DDL", no luck.

Another issue is that, if I change the 'labels' attribute in changeSets to 'context', LB doesn't generate anything using --contexts="v13_0_00_03, CONFIG".

Are these bugs or have I missed anything here?

1

1 Answers

1
votes

The only possibility that I can think of is that the DDL changes have already been applied. You have the changeset that is labeled DDL as runOnChange=false, so even if the file has changed it will not re-run.