Wiki Spaces


Get Help from Others

Q&A: Ask OpenMRS
Discussion: OpenMRS Talk
Real-Time: IRC Chat | Slack


Page tree

Versions Compared


  • This line was added.
  • This line was removed.
  • Formatting was changed.

Table of Contents

So you want to make a data model change?


  1. Open the /api/src/main/resources/liquibase-update-to-latest.xml file.
  2. Add your update to the end using liquibase's format for updates. See the liquibase manual for help.
    • Use any unique string for the The "id" . The must be a globally unique string across all changesets.  By convention, we use the current date+time is an easy one along with an optional incrementing suffix if needed – e.g: id="200804221449-1".
    • Use your trac username OpenMRS ID for the "author" attribute
    • Be sure to add a "comment" element in your changeSet, it is displayed in the webapp for end users to see
    • We recommend including the ticket number in the comment e.g "Add date_changed column to encounter_type table - TRUNK-2345"

Step Three: Deploy OpenMRS to Run the Changes


Commit both the liquibase xml file and code changes simultaneously to the subversion git hub repository.


Never ever change a changeset! (Well, almost never)

Once you commit something to a branch, you should assume that another developer has already checked out your code and applied the database changes! Therefore, you should not just go and modify a changeset! Instead you should add another changeset below the previous one that does the necessary modifications. That way no developers have to go and mess with their database to get the changesets to apply.

If Repair the changeset by adding a later changeset (with a different "id") is the preferred approach. But if a changeset contains an error , that you obviously must change it. However, you should change the liquibase changeset "id" on the element when you do so to prevent errors with other developerscorrect, follow the instructions on ?How to Modify a Bad Changeset.

Preconditions are important