GSoC 2021: Improving Functionalities of DHIS Connector Module - Project Updates

Unable to update data model using liquibase.xml - Module DHIS Connector

With the automated location mapping feature, the database of module will be changed a bit. Unwanted columns of both tables used in DHIS Connector Module will be removed.

This may cause an error saying Unable to update data model using liquibase.xml after updating the module. I found the solution for this issue from here

This sometimes happens with OpenMRS modules. Ideally liquibase existing changesets should never be modified and if there is a modification required, it should be added as a new and subsequent changeset.

Liquibase makes entries in table liquibasechangelog to keep track of executed changesets with a checksum/hash. When changeset is modified the checksum is found different and this error is encountered.

In above script we removed all tables created by previous version of team module, and also deleted all liquibase entries made by this module to allow module installation start from point zero. Offcourse, if it were production server, we never had deleted the tables. Also we never delete liquibase entries to avoid already executed changesets run again (this sometimes can also cause failed installations)

Deleting every row related to DHIS Connector module in the liquibasechangelog fixed the issue. Sometimes you may need to delete the report_to_dataset and location_to_orgunit table too

1 Like