Add missing indexes on ResourceIndexedSearchParamDate (#1847)

* Add migration tasks for new indexes. Add new indexes to ResourceIndexedSearchParamDate

* fix dates on task, remove redundant index

* Today is not the 20th

* Fix incorrectly named migration indexes

* out of order indexes
This commit is contained in:
Tadgh 2020-05-15 02:38:16 -07:00 committed by GitHub
parent 79a064dfd9
commit 9fec726b0e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 18 additions and 3 deletions

View File

@ -60,9 +60,11 @@ public class HapiFhirJpaMigrationTasks extends BaseMigrationTasks<VersionEnum> {
init410(); // 20190815 - 20191014
init420(); // 20191015 - 20200217
init430(); // Replaced by 5.0.0
init500(); // 20200218 - present
init500(); // 20200218 - 20200513
init501(); // 20200514 - present
}
/**
* Partway through the 4.3.0 releaase cycle we renumbered to
* 5.0.0 - We have a bunch of NOP tasks here to avoid breakage for anyone
@ -122,7 +124,17 @@ public class HapiFhirJpaMigrationTasks extends BaseMigrationTasks<VersionEnum> {
version.addNop("20200420.42");
}
protected void init500() { // 20200218 - present
private void init501() { //20200514 - present
Builder version = forVersion(VersionEnum.V5_0_1);
Builder.BuilderWithTableName spidxDate = version.onTable("HFJ_SPIDX_DATE");
spidxDate.addIndex("20200514.1", "IDX_SP_DATE_HASH_LOW").unique(false).withColumns("HASH_IDENTITY", "SP_VALUE_LOW");
spidxDate.addIndex("20200514.2", "IDX_SP_DATE_ORD_HASH").unique(false).withColumns("HASH_IDENTITY", "SP_VALUE_LOW_DATE_ORDINAL", "SP_VALUE_HIGH_DATE_ORDINAL");
spidxDate.addIndex("20200514.3", "IDX_SP_DATE_ORD_HASH_LOW").unique(false).withColumns("HASH_IDENTITY", "SP_VALUE_LOW_DATE_ORDINAL");
}
protected void init500() { // 20200218 - 20200519
Builder version = forVersion(VersionEnum.V5_0_0);
// Eliminate circular dependency.

View File

@ -54,8 +54,11 @@ import java.util.Date;
@Table(name = "HFJ_SPIDX_DATE", indexes = {
// We previously had an index called IDX_SP_DATE - Dont reuse
@Index(name = "IDX_SP_DATE_HASH", columnList = "HASH_IDENTITY,SP_VALUE_LOW,SP_VALUE_HIGH"),
@Index(name = "IDX_SP_DATE_HASH_LOW", columnList = "HASH_IDENTITY,SP_VALUE_LOW"),
@Index(name = "IDX_SP_DATE_ORD_HASH", columnList = "HASH_IDENTITY,SP_VALUE_LOW_DATE_ORDINAL,SP_VALUE_HIGH_DATE_ORDINAL"),
@Index(name = "IDX_SP_DATE_ORD_HASH_LOW", columnList = "HASH_IDENTITY,SP_VALUE_LOW_DATE_ORDINAL"),
@Index(name = "IDX_SP_DATE_RESID", columnList = "RES_ID"),
@Index(name = "IDX_SP_DATE_UPDATED", columnList = "SP_UPDATED"),
@Index(name = "IDX_SP_DATE_RESID", columnList = "RES_ID")
})
public class ResourceIndexedSearchParamDate extends BaseResourceIndexedSearchParam {