- change index name to match convention

- drop old index h2 automatically created
This commit is contained in:
nathaniel.doef 2022-12-14 11:04:54 -05:00
parent eb2a18c285
commit 59f35a1891
3 changed files with 12 additions and 6 deletions

View File

@ -85,8 +85,7 @@ public class TestUtil {
"FK_CONCEPTDESIG_CONCEPT", "FK_CONCEPTDESIG_CONCEPT",
"FK_TERM_CONCEPTPC_CHILD", "FK_TERM_CONCEPTPC_CHILD",
"FK_TERM_CONCEPTPC_PARENT", "FK_TERM_CONCEPTPC_PARENT",
"FK_TRM_VALUESET_CONCEPT_PID", "FK_TRM_VALUESET_CONCEPT_PID"
"FK_SEARCHINC_SEARCH"
); );

View File

@ -37,7 +37,7 @@ import javax.persistence.Table;
//@formatter:off //@formatter:off
@Entity @Entity
@Table(name = "HFJ_SEARCH_INCLUDE", indexes = { @Table(name = "HFJ_SEARCH_INCLUDE", indexes = {
@Index(name = "FK_SEARCHINC_SEARCH", columnList = "SEARCH_PID") @Index(name = "IDX_HFJ_SEARCH_INCLUDE_SRCHPID", columnList = "SEARCH_PID")
}) })
//@formatter:on //@formatter:on
public class SearchInclude implements Serializable { public class SearchInclude implements Serializable {

View File

@ -103,11 +103,18 @@ public class HapiFhirJpaMigrationTasks extends BaseMigrationTasks<VersionEnum> {
// Add new Index to HFJ_SEARCH_INCLUDE on SEARCH_PID // Add new Index to HFJ_SEARCH_INCLUDE on SEARCH_PID
version version
.onTable("HFJ_SEARCH_INCLUDE") .onTable("HFJ_SEARCH_INCLUDE")
.addIndex("20221207.1", "FK_SEARCHINC_SEARCH") .addIndex("20221207.1", "IDX_HFJ_SEARCH_INCLUDE_SRCHPID")
.unique(false) .unique(false)
.online(true) .online(true)
.withColumns("SEARCH_PID") .withColumns("SEARCH_PID");
.onlyAppliesToPlatforms(NON_AUTOMATIC_FK_INDEX_PLATFORMS);
// We are explicitly dropping the index FK_SEARCHINC_SEARCH. This index was automatically created on the
// SEARCH_PID column by H2 because it is a foreign key. It is no longer needed since IDX_HFJ_SEARCH_INCLUDE_SRCHPID
// is added above.
version
.onTable("HFJ_SEARCH_INCLUDE")
.dropIndex("20221207.2", "FK_SEARCHINC_SEARCH")
.failureAllowed();
} }
private void init620() { private void init620() {