Add init330() to migrate from 2.5 -> 3.3

This commit is contained in:
Graham, Gary 2018-12-12 21:00:41 -05:00
parent 81e8131ffc
commit a01d6cf302
3 changed files with 23 additions and 4 deletions

View File

@ -21,11 +21,13 @@ package ca.uhn.fhir.util;
*/ */
public enum VersionEnum { public enum VersionEnum {
V2_5_0,
V3_0_0,
V3_1_0,
V3_2_0,
V3_3_0, V3_3_0,
V3_4_0, V3_4_0,
V3_5_0, V3_5_0,
V3_6_0, V3_6_0,
V3_7_0 V3_7_0
} }

View File

@ -49,11 +49,14 @@ public class HapiFhirJpaMigrationTasks extends BaseMigrationTasks<VersionEnum> {
.map(FlagEnum::fromCommandLineValue) .map(FlagEnum::fromCommandLineValue)
.collect(Collectors.toSet()); .collect(Collectors.toSet());
init330();
init340(); init340();
init350(); init350();
init360(); init360();
} }
private void init360() { private void init360() {
Builder version = forVersion(VersionEnum.V3_6_0); Builder version = forVersion(VersionEnum.V3_6_0);
@ -542,6 +545,22 @@ public class HapiFhirJpaMigrationTasks extends BaseMigrationTasks<VersionEnum> {
} }
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_RESOURCE");
version.startSectionWithMessage("Starting work on table: " + hfjResVer.getTableName());
hfjResVer.modifyColumn("RES_ENCODING")
.nullable();
hfjResVer.modifyColumn("RES_TEXT")
.nullable();
}
public enum FlagEnum { public enum FlagEnum {
NO_MIGRATE_HASHES("no-migrate-350-hashes"); NO_MIGRATE_HASHES("no-migrate-350-hashes");

View File

@ -279,9 +279,7 @@ public class BaseMigrationTasks<T extends Enum> {
task.setNullable(myNullable); task.setNullable(myNullable);
task.setColumnType(theColumnType); task.setColumnType(theColumnType);
addTask(task); addTask(task);
} }
} }
} }