Merge pull request #1141 from tadgh/upgrade-25-to-33
Add the ability to upgrade 2.5 -> 3.3
This commit is contained in:
commit
b36e9dd27c
|
@ -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,
|
||||
|
|
|
@ -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");
|
||||
|
||||
|
|
|
@ -289,9 +289,7 @@ public class BaseMigrationTasks<T extends Enum> {
|
|||
task.setNullable(myNullable);
|
||||
task.setColumnType(theColumnType);
|
||||
addTask(task);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue