Incorrect MD5SUM computing

Dear Liquibase community, I would like to ask a question regarding MD5SUM computing during the “validate” or “update” Liquibase command.

Short preview: we decided to integrate Liquibase (version 4.2.2) into the MS SQL database which was managed without Liquibase. To do that we created so-called ‘baseline’ using ‘generateChangelog’ command, then synchronize state with ‘changeLogSync’ command and push everything to git repository. The DATABASECHANGELOG and DATABASECHANGELOGLOCK tables were created successfully and everything looked fine, so we were ready to apply changes to the DB using Liquibase on top of that generated changelog.

So, we created a first changeset, put it into the plain SQL formatted changelog and push it to the git. Then we pull repository to the worker node and try to deploy changes. But instead of apply changes Liquibase gave us an error:

Validation Error:
 2 change sets have changed since they were ran against the database

It is obvious that nothing was changed since we created a baseline, but this error appeared. I read a forum and found out that the issue might cause changed endings of lines (LF/CRLF), which might be modified by Git, therefore, I added .gitattributes file into the repository and specified ’ * text=false’ here, so Git does not modify anything during push/pull but it did not help. Also, I read that it is possible to clear MD5SUM column inside the “DATABASECHANGELOG” table and recalculate the MD5 during the execution of “update” command, however, this is not an option as we are going to manage many DBs with Liquibase, and this might cause lots of manual work and inconvenience.

Are there any ideas what might be the core issue of such behavior? Thank you in advance

Hi @illia.filipov !

May I ask for clarificaiton on this:

checking in git attribute file only affects the source from that point forward I believe, so if you committed after your initial commit, those files if they had the LF/CRLF modification issue you mentioned, it would still be present.

Regardless, could you show:

  • the changesets in question,
  • complete error message (need to see what the md5hashes are)
  • rows from the databasechangelog table.

This will help diagnose and troubleshoot.

Thanks,

Ronak