We have written an application using liquibase which is widely distributed to users outside of our control. So it is important that upgrades are solid and reliable. Liquibase has been terrific for us except that the way checksums are implemented causes more difficulty than assistance.
Is there a way to disable checksum verification in liquibase, either in total or for just one changeset?
To avoid lots of responses telling me how daft we are for disabling checksums, I’ll and explain some of our use cases.
We sometimes go back and fix an old migration which wasn’t coded quite right. We don’t want it to run again for users who executed it fine. We can manually add a checksum value to the changeset, so we have a workaround which is annoying but OK.
We have a changeset which imports some data from CSV to set up a user’s database the way we want. We never want to overwrite that data later on in an upgrade, as the user may have changed it in all sorts of ways. However we also want to improve that setup data in a future release so that new users of our application get new and improved setup data. That migration should not run again for existing users, but it also should not fail the checksum because the CSV file changed. It is quite hard to catch this checksum failure problem with unit tests since we would in theory have to upgrade every release of the application to every other release.
To my mind, the whole concept of checksums is poorly implemented for our particular needs. Checksums should warn developers committing bad changes by accident. If the checksum was committed to version control then junit or the CI could warn you of changes. If every changeset was put in a separate file, then we could create commit hooks to warn on changes to old files.
However by making a checksum a feature which blocks upgrade in an environment we don’t control for a changeset which has already run, for a change we didn’t want to execute anyway since it was already run. Well, that’s something I’d like to be able to disable.