diff --git a/hapi-fhir-jpaserver-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/tasks/HapiFhirJpaMigrationTasks.java b/hapi-fhir-jpaserver-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/tasks/HapiFhirJpaMigrationTasks.java index 7638ed1b601..3cea17c82b0 100644 --- a/hapi-fhir-jpaserver-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/tasks/HapiFhirJpaMigrationTasks.java +++ b/hapi-fhir-jpaserver-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/tasks/HapiFhirJpaMigrationTasks.java @@ -56,10 +56,20 @@ public class HapiFhirJpaMigrationTasks extends BaseMigrationTasks { init360(); // 20180918 - 20181112 init400(); // 20190401 - 20190814 init410(); // 20190815 - 20191014 - init420(); // 20191015 - present + init420(); // 20191015 - 20200217 + init430(); // 20200218 - present } - protected void init420() { // 20191015 - present + protected void init430() { // 20200218 - present + Builder version = forVersion(VersionEnum.V4_3_0); + + // Eliminate circular dependency. + version.onTable("HFJ_RESOURCE").dropColumn("20200218.1", "FORCED_ID_PID"); + version.onTable("HFJ_RES_VER").dropColumn("20200218.2", "FORCED_ID_PID"); + version.onTable("HFJ_RES_VER").addForeignKey("20200218.3", "FK_RESOURCE_HISTORY_RESOURCE").toColumn("RES_ID").references("HFJ_RESOURCE", "RES_ID"); + } + + protected void init420() { // 20191015 - 20200217 Builder version = forVersion(VersionEnum.V4_2_0); // TermValueSetConceptDesignation