diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/util/VersionEnum.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/util/VersionEnum.java index 39290e20b00..93fb002cafe 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/util/VersionEnum.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/util/VersionEnum.java @@ -21,7 +21,10 @@ package ca.uhn.fhir.util; */ public enum VersionEnum { - + V2_5_0, + V3_0_0, + V3_1_0, + V3_2_0, V3_3_0, V3_4_0, V3_5_0, 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 239adab37ea..3f9f3ca4bb9 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 @@ -49,11 +49,14 @@ public class HapiFhirJpaMigrationTasks extends BaseMigrationTasks { .map(FlagEnum::fromCommandLineValue) .collect(Collectors.toSet()); + init330(); init340(); init350(); init360(); } + + private void init360() { Builder version = forVersion(VersionEnum.V3_6_0); @@ -542,6 +545,22 @@ public class HapiFhirJpaMigrationTasks extends BaseMigrationTasks { } + private void init330() { + Builder version = forVersion(VersionEnum.V3_3_0); + + Builder.BuilderWithTableName hfjResource = version.onTable("HFJ_RESOURCE"); + version.startSectionWithMessage("Starting work on table: " + hfjResource.getTableName()); + hfjResource.dropColumn("RES_TEXT"); + hfjResource.dropColumn("RES_ENCODING"); + + Builder.BuilderWithTableName hfjResVer = version.onTable("HFJ_RES_VER"); + version.startSectionWithMessage("Starting work on table: " + hfjResVer.getTableName()); + hfjResVer.modifyColumn("RES_ENCODING") + .nullable(); + hfjResVer.modifyColumn("RES_TEXT") + .nullable(); + } + public enum FlagEnum { NO_MIGRATE_HASHES("no-migrate-350-hashes"); diff --git a/hapi-fhir-jpaserver-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/tasks/api/BaseMigrationTasks.java b/hapi-fhir-jpaserver-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/tasks/api/BaseMigrationTasks.java index 84eec4d7d0b..b62c76eef8a 100644 --- a/hapi-fhir-jpaserver-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/tasks/api/BaseMigrationTasks.java +++ b/hapi-fhir-jpaserver-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/tasks/api/BaseMigrationTasks.java @@ -289,9 +289,7 @@ public class BaseMigrationTasks { task.setNullable(myNullable); task.setColumnType(theColumnType); addTask(task); - } - } }