-
Notifications
You must be signed in to change notification settings - Fork 80
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[#255] Fixing 'liquibase' domain issues against Core 2.5.5+. #256
Conversation
…Files relative to changeset
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems like a good idea to me!
@mseaton So, I'm running into issues with this change. Specifically, the |
That isn't an absolute path @ibacher . It's a path relative to the application data directory, specifically "configuration/pih/liquibase/xxx.xml" If it is helpful @ibacher , we are successfully using the Iniz liquibase domain in our Rwanda distribution here. |
@mseaton Yeah, I discovered a different bug in core that needs fixing. |
The genesis of this is trying to use the liquibase domain on an OpenMRS 2.5.x instance to load a liquibase file that contains "sqlFile" changesets which refer to sql files at a relative path, which fails due to an NPE.
This is something I had noticed a long time ago, and we worked around in our main PIH EMR distribution by a) patching core, and b) using a custom liquibase loader at startup. You can see that code here, which has been used successfully in that distribution for years. This also addresses an issue that I brought up on the core ticket which provided the necessary fixes in 2.5.x and beyond, where we discovered an issue with the previous use of absolute file paths in the liquibase changelog. Basically, the use of absolute paths made the changesets non-portable, so migrating (say) from
/home/tomcat7/.OpenMRS
to/home/tomcat8/.OpenMRS
and then restarting your sever would result in all of the changes in the liquibase file getting re-executed, whether they already had been or not, since the change in file would be interpreted by liquibase as a totally new set of changesets. This could have very bad consequences if, for example, there are data migration or data cleanup changesets that were intended to run only once and never again and don't have sufficient preconditions on them.This PR aims to solve these issues for implementations that have reached OpenMRS 2.5 (although this will only work for OpenMRS 2.5.5+ due to where the core patch was installed).
@mks-d / @Ruhanga / @ibacher / @rbuisson let me know what you think.