Liquibase checksum changed with include tag in changelog

23 views Asked by At

Initially in my Spring Boot project, all my liquibase migration scripts were in the "migrations" folder, and changelog.xml file was lying outside:

- resources
--- db.changelog
----- migrations
----- changelog.xml

My changelog.xml file contains general script launch:

<includeAll path="migrations" relativeToChangelogFile="true"/>

Then I decided to edit the changelog to clearly indicate the order of the scripts (also I have deleted includeAll tag):

<include file="db/changelog/migrations/10-05-23--1--test-table.xml"/>
<include file="db/changelog/migrations/01-06-23--1--another-table.xml"/>

As a result, the changelog contains all the same scripts from the migrations folder.

When I run the project locally, it calculates md5sum checksums as before and there are no conflicts.

The problem arises when the Spring Boot application starts on another stand, it writes that the checksums of the first scripts have changed.

I don't understand what I need to pay attention to and what this might be connected with. I would be grateful for any advice.

1

There are 1 answers

0
htshame On

This is expected, because path to changelog file is part of the checksum.

I don't think you can do anything about it.

You can run clear-checksums command like mvn liquibase:clearCheckSums to clear existing checksums and recalculate them during the next deployment.