Hello People,
I am using openmrs-sdk-maven-plugin to package my distro and then using openmrs-sdk:run to test my packaged distro.
While packaging the distro, I am mentioning a base dbSql as well. This base dbSql gets copied as <targetDir>/dbdump/dump.sql. While this command works fine when I try to provide this SQL file as -DdbSql=<targetDir>/dbdump/dump.sql to openmrs-sdk:run, it fails with an error saying:
Failed to import database: Error executing: DELETE FROM openmrs.global_property WHERE property = âsearch.indexVersionâ
[ERROR] . Cause: org.apache.ibatis.jdbc.RuntimeSqlException: Line missing end-of-line terminator (; ) => DELETE FROM openmrs.global_property WHERE property = âsearch.indexVersionâ
While debugging the openmrs-sdk I figured out as part of copying the dump we add a query to delete the search.indexVersion property to every dump. Here is the line which does that. This query has the semicolon missing which is causing the dump to fail. Here is the link to the query.
I feel this is a bug, and I can raise a quick fix for this unless anyone else thinks otherwise.
@dkayiwa
Here is the card. For some reason I donât get exact options to specify in components section and this leads to all the cards being created as TRUNK instead of SDK/RA.
While I have fixed this issue and it works in my local, I see as part of BuildDistro it always assumes the database name to be openmrs. Line number 361 & 46 are hardcoding the Db name to OpenMRS. Looks like it was never meant to be any other database name other than openmrs.
That is a dump file of a database named openmrs. The reason why this string was parameterised is simply because the database name will not always be openmrs as you can clearly see from here.
However, I feel as part of BuildDistro we should be able to provide a parameterized database name and use that while generating the extra lines for dump.