Created
March 28, 2020 06:19
-
-
Save ssmusoke/628bebba6ee4225d009d801c04fc1429 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Caused by: liquibase.exception.MigrationFailedException: Migration failed for change set liquibase.xml::ugandaemr-01-10-2018-1200::slubwama: | |
Reason: liquibase.exception.DatabaseException: Error executing SQL INSERT INTO patient_program (patient_id, program_id, date_enrolled, location_id, creator, date_created, voided, uuid) | |
SELECT patient_id,(SELECT program.program_id FROM program WHERE program.uuid='de5d54ae-c304-11e8-9ad0-529269fb1459') AS program,encounter_datetime AS date_enrolled,location_id,encounter.creator,NOW(),0,UUID() AS uuid FROM encounter INNER JOIN encounter_type ON(encounter_type.encounter_type_id=encounter.encounter_type) WHERE encounter_type.uuid='8d5b27bc-c2cc-11de-8d13-0010c6dffd0f' GROUP BY patient_id: Cannot add or update a child row: a foreign key constraint fails (`kamccc`.`patient_program`, CONSTRAINT `patient_in_program` FOREIGN KEY (`patient_id`) REFERENCES `patient` (`patient_id`) ON UPDATE CASCADE): | |
Caused By: Error executing SQL INSERT INTO patient_program (patient_id, program_id, date_enrolled, location_id, creator, date_created, voided, uuid) | |
SELECT patient_id,(SELECT program.program_id FROM program WHERE program.uuid='de5d54ae-c304-11e8-9ad0-529269fb1459') AS program,encounter_datetime AS date_enrolled,location_id,encounter.creator,NOW(),0,UUID() AS uuid FROM encounter INNER JOIN encounter_type ON(encounter_type.encounter_type_id=encounter.encounter_type) WHERE encounter_type.uuid='8d5b27bc-c2cc-11de-8d13-0010c6dffd0f' GROUP BY patient_id: Cannot add or update a child row: a foreign key constraint fails (`kamccc`.`patient_program`, CONSTRAINT `patient_in_program` FOREIGN KEY (`patient_id`) REFERENCES `patient` (`patient_id`) ON UPDATE CASCADE): | |
Caused By: Cannot add or update a child row: a foreign key constraint fails (`kamccc`.`patient_program`, CONSTRAINT `patient_in_program` FOREIGN KEY (`patient_id`) REFERENCES `patient` (`patient_id`) ON UPDATE CASCADE) | |
at liquibase.changelog.ChangeSet.execute(ChangeSet.java:347) | |
at liquibase.changelog.visitor.UpdateVisitor.visit(UpdateVisitor.java:27) | |
at org.openmrs.util.DatabaseUpdater$1OpenmrsUpdateVisitor.visit(DatabaseUpdater.java:189) | |
at liquibase.changelog.ChangeLogIterator.run(ChangeLogIterator.java:58) | |
at org.openmrs.util.DatabaseUpdater.executeChangelog(DatabaseUpdater.java:218) | |
at org.openmrs.module.ModuleFactory.runLiquibase(ModuleFactory.java:1024) | |
... 2 more | |
Caused by: liquibase.exception.DatabaseException: Error executing SQL INSERT INTO patient_program (patient_id, program_id, date_enrolled, location_id, creator, date_created, voided, uuid) | |
SELECT patient_id,(SELECT program.program_id FROM program WHERE program.uuid='de5d54ae-c304-11e8-9ad0-529269fb1459') AS program,encounter_datetime AS date_enrolled,location_id,encounter.creator,NOW(),0,UUID() AS uuid FROM encounter INNER JOIN encounter_type ON(encounter_type.encounter_type_id=encounter.encounter_type) WHERE encounter_type.uuid='8d5b27bc-c2cc-11de-8d13-0010c6dffd0f' GROUP BY patient_id: Cannot add or update a child row: a foreign key constraint fails (`kamccc`.`patient_program`, CONSTRAINT `patient_in_program` FOREIGN KEY (`patient_id`) REFERENCES `patient` (`patient_id`) ON UPDATE CASCADE) | |
at liquibase.executor.jvm.JdbcExecutor.execute(JdbcExecutor.java:62) | |
at liquibase.executor.jvm.JdbcExecutor.execute(JdbcExecutor.java:104) | |
at liquibase.database.AbstractDatabase.execute(AbstractDatabase.java:1091) | |
at liquibase.database.AbstractDatabase.executeStatements(AbstractDatabase.java:1075) | |
at liquibase.changelog.ChangeSet.execute(ChangeSet.java:317) | |
... 7 more | |
Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLIntegrityConstraintViolationException: Cannot add or update a child row: a foreign key constraint fails (`kamccc`.`patient_program`, CONSTRAINT `patient_in_program` FOREIGN KEY (`patient_id`) REFERENCES `patient` (`patient_id`) ON UPDATE CASCADE) | |
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) | |
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) | |
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) | |
at java.lang.reflect.Constructor.newInstance(Constructor.java:423) | |
at com.mysql.jdbc.Util.handleNewInstance(Util.java:411) | |
at com.mysql.jdbc.Util.getInstance(Util.java:386) | |
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1041) | |
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:4237) | |
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:4169) | |
at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:2617) | |
at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2778) | |
at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2819) | |
at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2768) | |
at com.mysql.jdbc.StatementImpl.execute(StatementImpl.java:949) | |
at com.mysql.jdbc.StatementImpl.execute(StatementImpl.java:795) | |
at liquibase.executor.jvm.JdbcExecutor$1ExecuteStatementCallback.doInStatement(JdbcExecutor.java:92) | |
at liquibase.executor.jvm.JdbcExecutor.execute(JdbcExecutor.java:55) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment