I am trying to run the OpenMRS Reference Application from docker-compose. When it starts up, I see the following error sequence in the log:
There was an error while updating the database to the latest. file: org/openmrs/liquibase/updates/liquibase-update-to-latest-2.0.x.xml. Error: Migration failed for change set liquibase-update-to-latest.xml::1::upul:
Failed SQL: (1146) ALTER TABLE openmrs.person_attribute_type ADD edit_privilege VARCHAR(255) NULL
OK, so it seems that my error stems from the fact that Liquibase is trying to apply change-sets, but there is no existing schema/snapshot in the database (db only contains the two Liquibase tables: openmrs.liquibasechangelog and openmrs.liquibasechangeloglock).
So, I assume this means I have to manually create the initial schema? How do I do this, and why is this not part of the initial setup of the Reference Application?
Ah, I made a booboo. I had DB_CREATE_TABLES=true in my .env file, but in the docker-compose.yml I had earlier hard-coded DB_CREATE_TABLES=false, so it was using that, not the true value from the .env file.
There was an error while updating the database to the latest. file: org\openmrs\liquibase\updates\liquibase-update-to-latest-2.0.x.xml. Error: liquibase.exception.LiquibaseException: Unable to execute change set: liquibase-update-to-latest.xml::1::upul Error while trying to update to the latest database version
I don’t know, I used a completely different method: running the reference application using docker-compose. You need to define an environment variable DB_CREATE_TABLES=true in whichever process/shell you’re running Jetty from.