Merge pull request #1141 from tadgh/upgrade-25-to-33

Add the ability to upgrade 2.5 -> 3.3
This commit is contained in:
James Agnew 2019-05-29 21:33:17 -04:00 committed by GitHub
commit b36e9dd27c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 23 additions and 3 deletions

View File

@ -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,

View File

@ -49,11 +49,14 @@ public class HapiFhirJpaMigrationTasks extends BaseMigrationTasks<VersionEnum> {
.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<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_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");

View File

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