Hi,
I am using Liquibase 4.4 and want to upgrade to 4.6.
When upgrading, I got migration error (MigrationFailedException) because Liquibase was trying to run my scripts even though nothing was changed.
I compared the ‘databasechangelog’ checksum of my scripts, between existing database and a new one created with 4.6.2.
I noticed that the md5 checksum is the same on both. The only difference I saw was with the column ‘filename’:
In my original database created with 4.4 the file name is db/config/../changes/baseline/0001_newTenant.sql
, but with 4.6 it is created as db/changes/baseline/0001_newTenant.sql
.
Technically, this is the exact same path. But somehow liquibase doesn’t recognize it now and cause my upgrade to fail, thinking this is a new script.
To validate that this is indeed the issue, I manually changed ‘databasechangelog.filename’ in my existing database to the new format generated by v4.6, and it worked.
My changelog file db.changelog-baseline.xml
is looking like this:
<include file="../changes/baseline/0001_newTenant.sql" relativeToChangelogFile="true"/>
And the folder structure is:
└───db
├───changes
│ └───baseline
│ 0001_newTenant.sql
├───config
│ db.changelog-baseline.xml
Right now, I’ve also found a workaround: I added the logicalfilepath
to my changeset files like this:
-- changeset yoely:0001 dbms:postgresql logicalfilepath:db/config/../changes/baseline/0001_newTenant.sql
So even though I found a workaround, this is still a lot of work to do for all of my projects and change files.
Is there any better workaround for it? Or maybe a fix to Liquibase to prevent such confusion ?
Thanks,
Ori