3702 mpi link add index (#3708)

* 3702 - added index to mpi_link

* added changelog file
This commit is contained in:
kateryna-mironova 2022-06-16 13:23:23 -04:00 committed by GitHub
parent 3da39aeda3
commit 93b89b2bd7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 14 additions and 0 deletions

View File

@ -0,0 +1,4 @@
---
type: add
issue: 3702
title: "Added index for table MPI_LINK on attributes MATCH_RESULT, TARGET_PID and VERSION"

View File

@ -36,6 +36,7 @@ import javax.persistence.ForeignKey;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Index;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.SequenceGenerator;
@ -52,6 +53,8 @@ import java.util.Date;
// v---- this one
//TODO GGG revisit adding this: @UniqueConstraint(name = "IDX_EMPI_GR_TGT", columnNames = {"GOLDEN_RESOURCE_PID", "TARGET_PID"}),
//TODO GGG Should i make individual indices for PERSON/TARGET?
}, indexes = {
@Index(name = "IDX_EMPI_MATCH_TGT_VER", columnList = "MATCH_RESULT, TARGET_PID, VERSION")
})
public class MdmLink extends BasePartitionable implements IMdmLink {
public static final int VERSION_LENGTH = 16;

View File

@ -386,6 +386,13 @@ public class HapiFhirJpaMigrationTasks extends BaseMigrationTasks<VersionEnum> {
version.onTable("NPM_PACKAGE_VER_RES")
.modifyColumn("20220501.2","FHIR_VERSION_ID").nonNullable().withType(ColumnTypeEnum.STRING, 20);
// Fix for https://gitlab.com/simpatico.ai/cdr/-/issues/3166
version.onTable("MPI_LINK")
.addIndex("20220613.1", "IDX_EMPI_MATCH_TGT_VER")
.unique(false)
.online(true)
.withColumns("MATCH_RESULT", "TARGET_PID", "VERSION");
}
/**