Use liquibase to deal with database changes and to simplify DHIS update process?

Hi,

OpenMRS uses a tool called Liquibase (http://www.liquibase.org/) to take care of database changes on application startup.
The tool keeps track of all changes to the database and updates the local database when starting up the application.

The tools also helps to allow users to create a new database from the browser when starting up the first time.

All in all it provides some great improvements to usability and simplifies implementation. I think of the thousand of installations in India needing database changes as on use case that could benefit from this…

A summary from OpenMRS on what Liquibase added:

  1. All database updates are now executed when the API is started. No need to source a .sql file on your database directly.
  2. There is a setup wizard in the war file now. The wizard will walk you through creating your database and your runtime properties file.

Here’s more doc on how OpenMRS uses it:
http://n2.nabble.com/Liquibase-Integration-Branch-Merged-to-Trunk-td2102325.html#a2136404

http://openmrs.org/wiki/Data_Model_Update_Conventions
http://dev.openmrs.org/browser/openmrs/trunk/metadata/model/liquibase-update-to-latest.xml

http://openmrs.org/wiki/Step-by-Step_Installation_for_Developers

Ola Hodne Titlestad |Technical Officer|
Health Metrics Network (HMN) | World Health Organization

Avenue Appia 20 |1211 Geneva 27, Switzerland | Email: titlestado@who.int|Tel: +41 788216897
Website: www.healthmetricsnetwork.org

Better Information. Better Decisions. Better Health.

Here is a screen shot to give you an illustration of what a database update process could look like using liquibase.

image

I agree the new openmrs installation and update process is very slick. Does anyone have the time to investigate further how we might apply something similar. Student project?

Cheers
Bob

···

2009/9/29 Ola Hodne Titlestad olatitle@gmail.com

Here is a screen shot to give you an illustration of what a database update process could look like using liquibase.


Mailing list: https://launchpad.net/~dhis2-devs

Post to : dhis2-devs@lists.launchpad.net

Unsubscribe : https://launchpad.net/~dhis2-devs

More help : https://help.launchpad.net/ListHelp

Sorry deadline for submitting student projects was yesterday…

···

On Tue, Sep 29, 2009 at 12:54 PM, Bob Jolliffe bobjolliffe@gmail.com wrote:

I agree the new openmrs installation and update process is very slick. Does anyone have the time to investigate further how we might apply something similar. Student project?

I had tutored one student nishtha who was learning java to implement these beautiful looking setup screens of openmrs.

So I know its quite simple to inplement and applying updates works quite out of the box in liquibase. Though I don't fully understand why we want to use it in dhis.

···

Sent from my BlackBerry®

-----Original Message-----
From: Bob Jolliffe <bobjolliffe@gmail.com>
Date: Tue, 29 Sep 2009 11:54:08
To: Ola Hodne Titlestad<olatitle@gmail.com>
Cc: DHIS 2 developers<dhis2-devs@lists.launchpad.net>
Subject: Re: [Dhis2-devs] Use liquibase to deal with database changes and to
  simplify DHIS update process?

_______________________________________________
Mailing list: DHIS 2 developers in Launchpad
Post to : dhis2-devs@lists.launchpad.net
Unsubscribe : DHIS 2 developers in Launchpad
More help : ListHelp - Launchpad Help

Hi Saptarshi,

The main reason as I see it will be to avoid manual sql update scripts on all existing installations every time there is a change to the database that Hibernate cannot take care of. That happened quite often in the past, and still happens from time to time, although not as often as before as the data model has stabilised. If liquibase can track all changes to the data model (“master database”) and make sure the local database gets updated when loading a new war file that would be a great simplification of the update process I think. And my understanding is that it is used in openmrs for exactly the same reason. Why do you see DHIS as different from OpenMRS when it comes to using liquibase?

Ola

···

2009/9/29 sunbiz@gmail.com

I had tutored one student nishtha who was learning java to implement these beautiful looking setup screens of openmrs.

So I know its quite simple to inplement and applying updates works quite out of the box in liquibase. Though I don’t fully understand why we want to use it in dhis.


-----Original Message-----

From: Bob Jolliffe bobjolliffe@gmail.com

Date: Tue, 29 Sep 2009 11:54:08

To: Ola Hodne Titlestadolatitle@gmail.com

Cc: DHIS 2 developersdhis2-devs@lists.launchpad.net

Subject: Re: [Dhis2-devs] Use liquibase to deal with database changes and to

    simplify DHIS update process?

Mailing list: https://launchpad.net/~dhis2-devs

Post to : dhis2-devs@lists.launchpad.net

Unsubscribe : https://launchpad.net/~dhis2-devs

More help : https://help.launchpad.net/ListHelp

Openmrs started using liquibase because these database scripts were taken from mysqldump and could not b used with other dbms many times. Liquibase makes it kind of database independent.

Don’t get me wrong I really love liquibase, but it also adds some xml overhead and small but learning curve.

The way I see openmrs and dhis different is that the dhis model is made by the user and its ui driven. Most of the basics are very much stable. Openmrs on the other hand is changing its model and not user, but developer driven. These reasons made me ask question if others feel the need to have liquibase for database chnages

···

Sent from my BlackBerry®


From: Ola Hodne Titlestad olatitle@gmail.com

Date: Tue, 29 Sep 2009 13:22:23 +0200

To: sunbiz@gmail.com

Cc: Bob Jolliffebobjolliffe@gmail.com; DHIS 2 developersdhis2-devs@lists.launchpad.net

Subject: Re: [Dhis2-devs] Use liquibase to deal with database changes and tosimplify DHIS update process?

2009/9/29 sunbiz@gmail.com

I had tutored one student nishtha who was learning java to implement these beautiful looking setup screens of openmrs.

So I know its quite simple to inplement and applying updates works quite out of the box in liquibase. Though I don’t fully understand why we want to use it in dhis.

Hi Saptarshi,

The main reason as I see it will be to avoid manual sql update scripts on all existing installations every time there is a change to the database that Hibernate cannot take care of. That happened quite often in the past, and still happens from time to time, although not as often as before as the data model has stabilised. If liquibase can track all changes to the data model (“master database”) and make sure the local database gets updated when loading a new war file that would be a great simplification of the update process I think. And my understanding is that it is used in openmrs for exactly the same reason. Why do you see DHIS as different from OpenMRS when it comes to using liquibase?

Ola

-----Original Message-----

From: Bob Jolliffe bobjolliffe@gmail.com

Date: Tue, 29 Sep 2009 11:54:08

To: Ola Hodne Titlestadolatitle@gmail.com

Cc: DHIS 2 developersdhis2-devs@lists.launchpad.net

Subject: Re: [Dhis2-devs] Use liquibase to deal with database changes and to

    simplify DHIS update process?

Mailing list: https://launchpad.net/~dhis2-devs

Post to : dhis2-devs@lists.launchpad.net

Unsubscribe : https://launchpad.net/~dhis2-devs

More help : https://help.launchpad.net/ListHelp