4337 - Added a new Index on the HFJ_SEARCH_INCLUDE Table on (#4339)

* 4337 - Added a new Index on the HFJ_SEARCH_INCLUDE Table on SEARCH_PID Column. Also, added a migration task for the Index.

* 4337 - Renamed the new DB Index to keep it to 30 chars.
This commit is contained in:
Kevin Dougan SmileCDR 2022-12-12 16:00:11 -05:00 committed by GitHub
parent d70c7bba8c
commit c03129f545
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 1 deletions

View File

@ -28,6 +28,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;
@ -35,7 +36,9 @@ import javax.persistence.Table;
//@formatter:off
@Entity
@Table(name = "HFJ_SEARCH_INCLUDE")
@Table(name = "HFJ_SEARCH_INCLUDE", indexes = {
@Index(name = "IDX_HFJ_SEARCH_INCLUDE_SRCHPID", columnList = "SEARCH_PID")
})
//@formatter:on
public class SearchInclude implements Serializable {

View File

@ -100,6 +100,13 @@ public class HapiFhirJpaMigrationTasks extends BaseMigrationTasks<VersionEnum> {
// FHIR ids contain a subset of ascii, limited to 64 chars.
.type(ColumnTypeEnum.STRING, 64);
// Add new Index to HFJ_SEARCH_INCLUDE on SEARCH_PID
version
.onTable("HFJ_SEARCH_INCLUDE")
.addIndex("20221207.1", "IDX_HFJ_SEARCH_INCLUDE_SRCHPID")
.unique(false)
.online(true)
.withColumns("SEARCH_PID");
}
private void init620() {