diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/migrate/tasks/HapiFhirJpaMigrationTasks.java b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/migrate/tasks/HapiFhirJpaMigrationTasks.java index 62d0fd69ee7..991559c73fe 100644 --- a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/migrate/tasks/HapiFhirJpaMigrationTasks.java +++ b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/migrate/tasks/HapiFhirJpaMigrationTasks.java @@ -221,6 +221,15 @@ public class HapiFhirJpaMigrationTasks extends BaseMigrationTasks { protected void init680() { Builder version = forVersion(VersionEnum.V6_8_0); + // HAPI-FHIR #4801 - Add New Index On HFJ_RESOURCE + Builder.BuilderWithTableName resourceTable = version.onTable("HFJ_RESOURCE"); + + resourceTable + .addIndex("20230502.1", "IDX_RES_RESID_UPDATED") + .unique(false) + .online(true) + .withColumns("RES_ID", "RES_UPDATED", "PARTITION_ID"); + Builder.BuilderWithTableName tagDefTable = version.onTable("HFJ_TAG_DEF"); tagDefTable.dropIndex("20230505.1", "IDX_TAGDEF_TYPESYSCODEVERUS");