Uploaded image for project: 'OpenMRS Core'
  1. OpenMRS Core
  2. TRUNK-1346

Database upgrades should become an explicit and manual process for admins

    XMLWordPrintable

    Details

    • Type: New Feature
    • Status: Closed
    • Priority: Should
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: OpenMRS 1.5.0
    • Component/s: None
    • Labels:
      None

      Description

      When the system is upgraded, the admin should step through an explicit upgrade process. We never change the database without getting confirmation first. Nor do we want to make it overly complex (e.g., making runtime property changes to bypass upgrade(s) or making it so flexible that it's confusing).

      WordPress has a nice model:

      1. Upgrade the code (in our case, the WAR)\\\\
      2. If the existing database is compatible with the new WAR, then OpenMRS runs and the admin sees a banner saying "you need to upgrade your database: click here to begin"\\\\If the existing databaseis not compatible with the new WAR, all OpenMRS requests redirect to a page saying "This system needs to be upgraded. Click here to log in as admin and perform upgrade."\\\\
      3. In either case, the upgrade is accessible to the admin as an explicit opt-in process with appropriate warning about backing up the database (perhaps eventually even offering to automatically perform the db backup as the first step of the process) and then requiring a click of an "Upgrade my database" button.

      At the API level, starting the API after upgrading should optionally throw a DatabaseMustBeUpdatedException or a DatabaseShouldBeUpdatedException. If the latter is thrown, then one could still successfully start the API with a Context.startupWithoutUpdates(). Otherwise, you would need to first call Context.updateDatabase() and only after that succeeds could you successfully call Context.startup().

        Attachments

          Activity

            People

            Assignee:
            bwolfe Ben Wolfe
            Reporter:
            burke Burke Mamlin
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: