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

OpenMRS 2.5+ unable to execute liquibase files outside of classpath



    • Bug
    • Status: Closed
    • Should
    • Resolution: Fixed
    • None
    • Core 2.6.0, Core 2.5.5
    • None
    • None


      In OpenMRS 2.3 and earlier, the version of Liquibase that was included was able to execute changeset files at a filesystem path, and supported relative paths withing sqlChange elements withing these changesets. This is something we've leveraged to allow for executing SQL migrations and other custom SQL changes in our configuration, without requiring us to deliver these in a compiled module on the classpath.

      In OpenMRS 2.5+ (and possibly 2.4, depending on when the liquibase library update was done), this no longer works. There are several separate issues to resolve:

      1. There is a bug in Liquibase where it does not properly handle relative paths within a changeset. This is described here: https://github.com/liquibase/liquibase/issues/1277 and fixed in this commit: https://github.com/liquibase/liquibase/commit/631bc875fe5d0baf46c0dfeca6ceb64072c4a105 which was released in maintenance release in the 4.4.x line as 4.4.3. As we are currently including 4.4.1, this will require updating to this maintenance release.

      2. There is a "feature" added/changed in the 4.x line of Liquibase as described here: https://docs.liquibase.com/concepts/changelogs/how-liquibase-finds-files.html. The result is that liquibase is unable to find files specfied as absolute paths, but requires some base path to be configured. To match what was in place before, we could add the root path "/". Alternatively, to better adhere to the reason why Liquibase removed this, we could add in the application data directory. This is the direction I plan to take (application data directory), but we can adjust as needed.

      3. Liquibase doesn't seem to resolve SQL files with the file system resource accessor by default, but only with the class path resource accessor. We need to fix things in the code that invokes Liquibase to ensure both the filesystem and class path resource accessors are provided.

      Gliffy Diagrams




              mseaton Mike Seaton
              mseaton Mike Seaton
              0 Vote for this issue
              3 Start watching this issue