Liquibase - checksum differs with different databa

2019-07-04 00:10发布

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?

2条回答
The star\"
2楼-- · 2019-07-04 00:50

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.

查看更多
劫难
3楼-- · 2019-07-04 00:57

The checksum is actually computed based on a normalized version of the changeset text, not the SQL and should be unrelated to the database type.

Are you running on different OS versions for the different databases?

查看更多
登录 后发表回答