Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Liquibase - checksum differs with different database vendors

I have a problem with Liquibase checksum when I try to run it on MSSQL and MySQL.

In my MSSQL-base I have a changelog-entry with this checksum:

3:cf2f5de7a1dcc738bbc185e25fbcf6c9

When I run my liquibase against this database, it works just fine.

Then, I copy the changelog-entry to my MySQL-database and try to run, and get this error:

myLiquibase.xml::1::Tobb is now: 3:cedf7a8ba54ea3f83141f79

I have tried setting the checksum to null in my MSSQL in order to regenerate the checksum, and the checksum reverts back to

3:cf2f5de7a1dcc738bbc185e25fbcf6c9

When doing the same in MySQL, i get this checksum:

3:cedf7a8ba54ea3f83141f7987007deb7

So, from what I can see, depending on whether it's run in MSSQL or MySQL, Liquibase generates a different checksum. How can this happen? I thought the checksum was only dependant on the actual content of the liquibase-script?

like image 677
Tobb Avatar asked Dec 07 '25 10:12

Tobb


1 Answers

Yes, it depends on content and DB type, because actually checksum depends not on your changeset text, but on sql which is generated for current DB, which will slightly different for different DBs.

If you want to avoid checksum erros, you can use validCheckSum tag in changesets.

like image 62
Andremoniy Avatar answered Dec 09 '25 22:12

Andremoniy