Occasionally we may discover a bug introduced by a bad changeset, and want to fix the changeset so that people who upgrade in the future don't run into this. This is possible, but it's important to follow the correct process.
The reason we have to do this is that liquibase keeps checksums of all changesets that have ever been run on your database, so if you modify a changeset after anybody has run it, that user will get an error and be unable to start OpenMRS the first time they try to run an OpenMRS version with the modified changeset. The workaround is to explicitly list all valid checksums, so that things don't break for people who already ran the old version of the changeset. (Note: this will not re-run the new changeset for people who ran the original one. Depending on the bug you're trying to fix, you may also need to add a new changeset to clean up after the original version of the old one.)
What to do:
- Find the changeset you'd like to modify in liquibase-update-to-latest.xml. Make your change, and restart OpenMRS.
- You will see an error message like this
- Note down the MD5Sum that is reported. This is the checksum for the new version of the changeset. (In this case it is "4d67c48557f5665a8c2be7e87e22913".)
- Look in the liquibasechangelog table in your database for the checksum of the old version of the changeset. For example
- Go back to the changeset in liquibase-update-to-latest.xml and add a validCheckSum subtag for both the old and new checksums, making sure to comment them. For example: