Liquibase sqlFile in changeset not executed


I am trying to run a changeset with sqlFile tag but it isn’t getting executed. The liquibase update command says successfully executed but the databasechangelog also doesn’t contain any reference of the changeset.

Below is my master changeset.xml

<?xml version="1.0" encoding="UTF-8"?>  

  <include file="changesets/release1/changelog.xml" labels="release1" relativeToChangelogFile="true"/>
  <include file="changesets/release2/changelog.xml" labels="release2" relativeToChangelogFile="true"/>

Below is my release1/changelog.xml

<?xml version="1.0" encoding="UTF-8"?>
<databaseChangeLog  xmlns=""

    <!-- Please assign labels for all changesets as this will be used in DB Change Log table. -->
    <property name="label" value="release1" />

    <changeSet labels="${label}" author="anuj.batra" id="sample.1.changeset" runOnChange="true" context="${label}">
        <comment>This section makes sure to enter values of the reason why change is made.</comment>
        <sqlFile dbms="h2, oracle, mysql" encoding="UTF-8" path="rollforward/sample.changeset.sql" relativeToChangelogFile="true" />
            <sqlFile dbms="h2, oracle, mysql" path="rollback/sample.changeset.rollback.sql" relativeToChangelogFile="true"/>


Below is my roolforward.sql file

    PersonID int,
    LastName varchar(255),
    FirstName varchar(255),
    Address varchar(150),
    City varchar(255)
INSERT INTO People (PersonID, LastName, FirstName, Address, City)
VALUES (1, 'Doe', 'John', '1 Woolworths Way', 'Bella Vista');

INSERT INTO People (PersonID, LastName, FirstName, Address, City)
VALUES (2, 'Doe 1', 'John', '1 Woolworths Way', 'Bella Vista');

INSERT INTO People (PersonID, LastName, FirstName, Address, City)
VALUES (3, 'Doe 2', 'John', '1 Woolworths Way', 'Bella Vista');

INSERT INTO People (PersonID, LastName, FirstName, Address, City)
VALUES (4, 'Doe 3', 'John', '1 Woolworths Way', 'Bella Vista');

I’ve tried deleting the database changelog and lock tables to import again but no luck. Both release1 and release2 changesets are not getting executed

I am using mysql database and below is my properties file


Below is my databasechangelog
|1612221150384|liquibase|liquibase-internal|2021-02-02 10:12:30|1|EXECUTED|8:d41d8cd98f00b204e9800998ecf8427e|empty||release2|4.2.1|NULL|NULL|2221150315|

Hello @abatra!

From what you’ve provided, I don’t see anything obvious that might be causing the sample.changeset.sql script to be skipped. What might be helpful is a description of the directory structure of your changelog files. When working with includes things can get a little tricky at first.

It would also be great to see a DEBUG log from the update.


1 Like

Hi @abatra ,

I am seeing something and I wonder if this might be the root cause of the issue (mismatch between the file name and the value set in the path attribute?):

The sqlFile path is set to: =“rollforward/sample.changeset.sql”
The presented sql file is named: roolforward.sql

If this doesn’t fix the issue, could you also add the folder structure (starting from root, where the main changelog reside)?

Also, what RDBMS are you using? If you are using something different than h2, oracle, mysql (i.e if using SQL Server or PostgreSQL) then this might be other cause. (edit update: based on the driver, the RDBMS is MySQL).

Hope this helps,

1 Like