Skip to content

Commit

Permalink
[JBPM-10224] Missing index 'IDX_EventTypes_IdElement' with hibernate (#…
Browse files Browse the repository at this point in the history
…2395) (#2409)

* [JBPM-10224] Missing index 'IDX_EventTypes_IdElement' with hibernate.hbm2ddl.auto=update

* [JBPM-10224] Align ddl-scripts for mysql5 and mysqlinnodb with creation of index 'IDX_EventTypes_IdElement'

* [JBPM-10224] Align ddl-scripts for mysql5 and mysqlinnodb with creation of index 'IDX_EventTypes_Id'

Co-authored-by: Daniele Mams <[email protected]>
  • Loading branch information
github-actions[bot] and danielemams authored Jul 4, 2024
1 parent 462defc commit 3c3cf57
Show file tree
Hide file tree
Showing 8 changed files with 21 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -769,8 +769,8 @@
create index IDX_TaskEvent_taskId on TaskEvent (taskId);
create index IDX_TaskEvent_processInstanceId on TaskEvent (processInstanceId);

create index IDX_EventTypes_element ON EventTypes(element);
create index IDX_EventTypes_compound ON EventTypes(InstanceId, element);
create index IDX_EventTypes_Id ON EventTypes(InstanceId);
create index IDX_EventTypes_IdElement ON EventTypes(InstanceId, element);

create index IDX_CMI_Context ON ContextMappingInfo(CONTEXT_ID);
create index IDX_CMI_KSession ON ContextMappingInfo(KSESSION_ID);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -788,8 +788,8 @@
create index IDX_TaskEvent_taskId on TaskEvent (taskId);
create index IDX_TaskEvent_processInstanceId on TaskEvent (processInstanceId);

create index IDX_EventTypes_element ON EventTypes(element);
create index IDX_EventTypes_compound ON EventTypes(InstanceId, element);
create index IDX_EventTypes_Id ON EventTypes(InstanceId);
create index IDX_EventTypes_IdElement ON EventTypes(InstanceId, element);

create index IDX_CMI_Context ON ContextMappingInfo(CONTEXT_ID);
create index IDX_CMI_KSession ON ContextMappingInfo(KSESSION_ID);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -768,8 +768,8 @@
create index IDX_TaskEvent_taskId on TaskEvent (taskId);
create index IDX_TaskEvent_processInstanceId on TaskEvent (processInstanceId);

create index IDX_EventTypes_element ON EventTypes(element);
create index IDX_EventTypes_compound ON EventTypes(InstanceId, element);
create index IDX_EventTypes_Id ON EventTypes(InstanceId);
create index IDX_EventTypes_IdElement ON EventTypes(InstanceId, element);

create index IDX_CMI_Context ON ContextMappingInfo(CONTEXT_ID);
create index IDX_CMI_KSession ON ContextMappingInfo(KSESSION_ID);
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
DROP INDEX IDX_EventTypes_element;
DROP INDEX IDX_EventTypes_compound;
CREATE INDEX IDX_EventTypes_IdElement ON EventTypes(InstanceId,element);
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
ALTER TABLE TimerMappingInfo ADD COLUMN processInstanceId bigint;
ALTER TABLE TimerMappingInfo MODIFY timerId bigint NULL;
ALTER TABLE TimerMappingInfo MODIFY timerId bigint NULL;
DROP INDEX IDX_EventTypes_element;
DROP INDEX IDX_EventTypes_compound;
CREATE INDEX IDX_EventTypes_IdElement ON EventTypes(InstanceId,element);
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
DROP INDEX IDX_EventTypes_element;
DROP INDEX IDX_EventTypes_compound;
CREATE INDEX IDX_EventTypes_IdElement ON EventTypes(InstanceId,element);
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
ALTER TABLE TimerMappingInfo ADD COLUMN processInstanceId bigint;
ALTER TABLE TimerMappingInfo MODIFY timerId bigint NULL;
ALTER TABLE TimerMappingInfo MODIFY timerId bigint NULL;
DROP INDEX IDX_EventTypes_element;
DROP INDEX IDX_EventTypes_compound;
CREATE INDEX IDX_EventTypes_IdElement ON EventTypes(InstanceId,element);
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ public class ProcessInstanceInfo implements PersistentProcessInstance {
@ElementCollection
@CollectionTable(name="EventTypes", joinColumns=@JoinColumn(name="InstanceId"),
indexes = {@Index(name = "IDX_EventTypes_Id", columnList="InstanceId"),
@Index(name = "IDX_EventTypes_element", columnList="element")})
@Index(name = "IDX_EventTypes_IdElement", columnList="InstanceId, element")})

@Column(name="element")
private Set<String> eventTypes = new HashSet<String>();
Expand Down

0 comments on commit 3c3cf57

Please sign in to comment.