Liquibase - checksum differs with different database vendors

家住魔仙堡 提交于 2019-12-23 20:35: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?


回答1:


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.




回答2:


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?



来源:https://stackoverflow.com/questions/25928628/liquibase-checksum-differs-with-different-database-vendors

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!