Index name fix (#4921)
* Index name fix * Build fix * Test restore * Revert change
This commit is contained in:
parent
d932730525
commit
307e52f88f
|
@ -121,24 +121,35 @@ public class HapiFhirJpaMigrationTasks extends BaseMigrationTasks<VersionEnum> {
|
|||
.online(false)
|
||||
.withColumns("TAG_TYPE", "TAG_CODE", "TAG_SYSTEM", "TAG_ID", "TAG_VERSION", "TAG_USER_SELECTED");
|
||||
|
||||
version.onTable("HFJ_RES_VER_PROV")
|
||||
.addIndex("20230510.1", "IDX_RESVERPROV_RES_VER_PID")
|
||||
version
|
||||
.onTable("HFJ_RES_VER_PROV")
|
||||
.addIndex("20230510.1", "IDX_RESVERPROV_RESVER_PID")
|
||||
.unique(false)
|
||||
.withColumns("RES_VER_PID")
|
||||
.failureAllowed();
|
||||
version.onTable("HFJ_RES_VER_PROV")
|
||||
.withColumns("RES_VER_PID");
|
||||
|
||||
version
|
||||
.onTable("HFJ_RES_VER_PROV")
|
||||
.addIndex("20230510.2", "IDX_RESVERPROV_RES_PID")
|
||||
.unique(false)
|
||||
.withColumns("RES_PID");
|
||||
|
||||
version.onTable(ResourceHistoryTable.HFJ_RES_VER)
|
||||
version
|
||||
.onTable(ResourceHistoryTable.HFJ_RES_VER)
|
||||
.addColumn("20230510.4", "SOURCE_URI")
|
||||
.nullable()
|
||||
.type(ColumnTypeEnum.STRING, 100);
|
||||
version.onTable(ResourceHistoryTable.HFJ_RES_VER)
|
||||
version
|
||||
.onTable(ResourceHistoryTable.HFJ_RES_VER)
|
||||
.addColumn("20230510.5", "REQUEST_ID")
|
||||
.nullable()
|
||||
.type(ColumnTypeEnum.STRING, 16);
|
||||
|
||||
version
|
||||
.onTable("HFJ_RES_VER_PROV")
|
||||
.addForeignKey("20230510.6", "FK_RESVERPROV_RES_PID")
|
||||
.toColumn("RES_PID")
|
||||
.references("HFJ_RESOURCE", "RES_ID");
|
||||
|
||||
}
|
||||
|
||||
protected void init660() {
|
||||
|
@ -920,11 +931,11 @@ public class HapiFhirJpaMigrationTasks extends BaseMigrationTasks<VersionEnum> {
|
|||
.unique(false)
|
||||
.withColumns("RES_ID");
|
||||
|
||||
|
||||
theVersion.onTable("HFJ_RES_VER_PROV")
|
||||
.addIndex("20211210.3", "FK_RESVERPROV_RES_PID")
|
||||
.unique(false)
|
||||
.withColumns("RES_PID")
|
||||
.doNothing() // This index is added below in a better form
|
||||
.onlyAppliesToPlatforms(NON_AUTOMATIC_FK_INDEX_PLATFORMS);
|
||||
|
||||
theVersion.onTable("HFJ_FORCED_ID")
|
||||
|
@ -1543,7 +1554,8 @@ public class HapiFhirJpaMigrationTasks extends BaseMigrationTasks<VersionEnum> {
|
|||
resVerProv
|
||||
.addForeignKey("20190921.15", "FK_RESVERPROV_RES_PID")
|
||||
.toColumn("RES_PID")
|
||||
.references("HFJ_RESOURCE", "RES_ID");
|
||||
.references("HFJ_RESOURCE", "RES_ID")
|
||||
.doNothing(); // Added below in a better form
|
||||
resVerProv.addColumn("SOURCE_URI").nullable().type(ColumnTypeEnum.STRING, 100);
|
||||
resVerProv.addColumn("REQUEST_ID").nullable().type(ColumnTypeEnum.STRING, 16);
|
||||
resVerProv.addIndex("20190921.16", "IDX_RESVERPROV_SOURCEURI").unique(false).withColumns("SOURCE_URI");
|
||||
|
|
|
@ -42,8 +42,7 @@ import static ca.uhn.fhir.jpa.model.entity.ResourceHistoryTable.SOURCE_URI_LENGT
|
|||
@Index(name = "IDX_RESVERPROV_SOURCEURI", columnList = "SOURCE_URI"),
|
||||
@Index(name = "IDX_RESVERPROV_REQUESTID", columnList = "REQUEST_ID"),
|
||||
@Index(name = "IDX_RESVERPROV_RES_PID", columnList = "RES_PID"),
|
||||
@Index(name = "IDX_RESVERPROV_RES_VER_PID", columnList = "RES_VER_PID")
|
||||
}, uniqueConstraints = {
|
||||
@Index(name = "IDX_RESVERPROV_RESVER_PID", columnList = "RES_VER_PID")
|
||||
})
|
||||
@Entity
|
||||
public class ResourceHistoryProvenanceEntity extends BasePartitionable {
|
||||
|
|
|
@ -19,7 +19,6 @@
|
|||
*/
|
||||
package ca.uhn.fhir.jpa.model.entity;
|
||||
|
||||
import ca.uhn.fhir.i18n.Msg;
|
||||
import ca.uhn.fhir.interceptor.model.RequestPartitionId;
|
||||
import ca.uhn.fhir.jpa.model.config.PartitionSettings;
|
||||
import org.apache.commons.lang3.builder.CompareToBuilder;
|
||||
|
|
|
@ -6,7 +6,6 @@ import org.junit.jupiter.api.BeforeEach;
|
|||
import org.junit.jupiter.api.Nested;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.junit.jupiter.params.ParameterizedTest;
|
||||
import org.junit.jupiter.params.provider.CsvSource;
|
||||
import org.junit.jupiter.params.provider.EnumSource;
|
||||
import org.junit.jupiter.params.provider.MethodSource;
|
||||
import org.junit.jupiter.params.provider.ValueSource;
|
||||
|
|
Loading…
Reference in New Issue