Readd migration (#5747)

* Re-add removed migration

* spotless
This commit is contained in:
Tadgh 2024-02-29 16:07:24 -05:00 committed by GitHub
parent f5cc015ff3
commit 3a1a0418a0
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 13 additions and 4 deletions

View File

@ -220,6 +220,14 @@ public class HapiFhirJpaMigrationTasks extends BaseMigrationTasks<VersionEnum> {
protected void init680() { protected void init680() {
Builder version = forVersion(VersionEnum.V6_8_0); 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"); Builder.BuilderWithTableName tagDefTable = version.onTable("HFJ_TAG_DEF");
tagDefTable.dropIndex("20230505.1", "IDX_TAGDEF_TYPESYSCODEVERUS"); tagDefTable.dropIndex("20230505.1", "IDX_TAGDEF_TYPESYSCODEVERUS");

View File

@ -230,11 +230,12 @@ public class PatientIdPartitionInterceptorTest extends BaseResourceProviderR4Tes
Patient patient = myPatientDao.read(patientVersionOne); Patient patient = myPatientDao.read(patientVersionOne);
assertEquals("1", patient.getIdElement().getVersionIdPart()); assertEquals("1", patient.getIdElement().getVersionIdPart());
myCaptureQueriesListener.logSelectQueries(); myCaptureQueriesListener.logSelectQueriesForCurrentThread();
assertEquals(4, myCaptureQueriesListener.getSelectQueries().size());
assertThat(myCaptureQueriesListener.getSelectQueries().get(0).getSql(false, false), containsString("PARTITION_ID in (?)"));
assertThat(myCaptureQueriesListener.getSelectQueries().get(1).getSql(false, false), containsString("PARTITION_ID="));
List<SqlQuery> selectQueriesForCurrentThread = myCaptureQueriesListener.getSelectQueriesForCurrentThread();
assertEquals(4, selectQueriesForCurrentThread.size());
assertThat(selectQueriesForCurrentThread.get(0).getSql(false, false), containsString("PARTITION_ID in (?)"));
assertThat(selectQueriesForCurrentThread.get(1).getSql(false, false), containsString("PARTITION_ID="));
} }