create table BPEL_ACTIVITY_INST (DBID_ bigint not null, CLASS_ varchar(255) not null, dbversion bigint not null, ACT_INST_UUID_ varchar(255), ACT_DEF_UUID_ varchar(500), PROCESS_UUID_ varchar(255), INST_UUID_ varchar(255), STARTED_DATE_ datetime, ENDED_DATE_ datetime, ACTIVITY_STATE_ varchar(255), LAST_EXCEPTION_ bigint, CHILD_ACT_INST_ID_ bigint, OPERATION_ varchar(255), VARIABLE_ varchar(255), MESSAGE_EXCHANGE_ varchar(255), FH_INST_ bigint, TH_INST_ bigint, CH_INST_ bigint, START_VALUE_ integer, STOP_VALUE_ integer, COMPLETION_CONDITION_VALUE_ integer, CHILD_WAIT_ACT_ bigint, PARENT_ACT_INST_ID_ bigint, INDEX_ integer, PARENT_SCOPE_ID_ bigint, primary key (DBID_)) ENGINE=InnoDB;
create table BPEL_BASE_ACTIVITY_DEF (DBID_ bigint not null, CLASS_ varchar(255) not null, dbversion bigint not null, ACT_DEF_UUID_ varchar(500), PROCESS_DEF_UUID_ varchar(255), NAME_ varchar(255), SUPPR_JN_FL_ bit, TGT_JN_CDT_EXP_LG_ varchar(255), TGT_JN_CDT_BLN_LG_ varchar(255), CHILD_ACT_DEF_ID_ bigint, FAULT_NAME_QNAME_ varchar(255), FAULT_MESSAGE_TYPE_QNAME_ varchar(255), FAULT_ELEMENT_QNAME_ varchar(255), faultVariable varchar(255), EX_ON_STA_FAULT_ bit, TERMINATION_HANDLER_ bigint, COMPENSATION_HANDLER_ bigint, NAMESPACE_ varchar(255), EXPR_LANG_ varchar(255), QUERY_LANG_ varchar(255), DPLY_DATE_ datetime, UNDPLY_DATE datetime, STATE_ varchar(255), TARGET_ varchar(255), IVK_PRTLNK_ varchar(255), IVK_IN_VAR_ varchar(255), IVK_OUT_VAR_ varchar(255), IVK_OPERATION_ varchar(255), IVK_PRT_PT_QNAME_ varchar(255), PT_QNAME_ varchar(255), FAULT_VARIABLE_ varchar(255), WHL_EXP_LANG_ varchar(255), WHL_BOOL_EXP_ varchar(255), RPU_EXP_LANG_ varchar(255), RPU_BOOL_EXP_ varchar(255), REC_CRT_INST_ bit, REC_VAR_ varchar(255), REC_PARTN_LNK_ varchar(255), REC_OPERATION_ varchar(255), REC_MSG_EXCHNG_ varchar(255), REC_PRT_PT_QNAME_ varchar(255), REP_VAR_ varchar(255), REP_PARTN_LNK_ varchar(255), REP_OPERATION_ varchar(255), REP_MSG_EXCHNG_ varchar(255), REP_PRT_PT_QNAME_ varchar(255), REP_FLT_NM_QNAME_ varchar(255), ASSIGN_VLDT_ bit, FOR_EXPR_LANG_ varchar(255), FOR_DUR_LANG_ varchar(255), UNTIL_EXPR_LANG_ varchar(255), UNTIL_DEAD_LANG_ varchar(255), IF_EXPR_LANG_ varchar(255), IF_EXPR_ varchar(255), ELSE_ACT_DEF_ID_ bigint, ELSE_ACT_UUID_ varchar(500), PK_DF_CR_INST_ bit, FRCH_C_N_EXPR_ varchar(255), FRCH_PARLLL_EXPR_ bit, FRCH_FINL_EXPR_ varchar(255), FRCH_FINL_EXPR_LG_ varchar(255), FRCH_STRT_EXPR_ varchar(255), FRCH_STRT_EXPR_LG_ varchar(255), FRCH_CD_EXPR_ varchar(255), FRCH_CD_EXPR_LG_ varchar(255), FRCH_CD_SUCC_ bit, PARENT_ACT_DEF_ID_ bigint, INDEX_ integer, SCOPE_ID_ bigint, primary key (DBID_)) ENGINE=InnoDB;
create table BPEL_FAULT_ (DBID_ bigint not null, CLASS_ varchar(255) not null, FAULT_QNAME_ varchar(255), MSG_PARTS_ longtext, ELT_ longtext, primary key (DBID_)) ENGINE=InnoDB;
create table BPEL_REC (DBID_ bigint not null, TYPE_ varchar(255), ACT_INST_UUID_ varchar(255), PROCESS_UUID_ varchar(255), INST_UUID_ varchar(255), DATA_ longblob, primary key (DBID_)) ENGINE=InnoDB;
create table COPY_FULL_IMPL (DBID_ bigint not null, KEEP_SRC_ELT_NAME bit, COPY_LST_ID_ bigint, INDEX_ integer, primary key (DBID_)) ENGINE=InnoDB;
create table CORR_DEF_ (DBID_ bigint not null, SETVALUE_ varchar(255), INITIATE_ varchar(255), ON_MSG_CORR_ID_ bigint, INDEX_ integer, ON_EVT_CORR_ID_ bigint, IVK_CR_DEF_ID_ bigint, REC_CR_DEF_ID_ bigint, RP_CR_DEF_ID_ bigint, primary key (DBID_)) ENGINE=InnoDB;
create table CS_INIT_FULL_IMPL (DBID_ bigint not null, ACT_INST_UUID_ varchar(255), DATE_ datetime, NAME_ varchar(255), SCOPE_ID_ bigint, INDEX_ integer, primary key (DBID_)) ENGINE=InnoDB;
create table ELSEIF_DEF_ (DBID_ bigint not null, ELSEIF_EXPR_ varchar(255), ELSEIF_EXPR_LANG_ varchar(255), ELSEIF_ACT_DEF_ID_ bigint, ELSEIF_ACT_UUID_ varchar(500), IF_ELSEIF_LST_ID_ bigint, INDEX_ integer, primary key (DBID_)) ENGINE=InnoDB;
create table FRM_PRT_DEF_ (DBID_ bigint not null, FP_PART_ varchar(255), FP_TO_VAR_ varchar(255), ON_MSG_FRM_PRT_ID_ bigint, INDEX_ integer, ON_EVT_FRM_PRT_ID_ bigint, IVK_FR_PT_ID_ bigint, REC_FR_PT_ID_ bigint, primary key (DBID_)) ENGINE=InnoDB;
create table FROM_TO_FULL (DBID_ bigint not null, CLASS_ varchar(255) not null, FT_VARIANT_ varchar(255), FT_EXP_LANG_ varchar(255), FT_VARIABLE_ varchar(255), FT_PART_ varchar(255), FT_PARTNER_LINK_ varchar(255), FT_ENDPOINT_REF_ varchar(255), FT_PROP_QNAME_ varchar(255), FT_EXPRESSION_ varchar(255), FT_QUERY_ varchar(255), FT_QUERY_LANG_ varchar(255), LITRL_VALUE_ varchar(3999), FROM_LST_ID_ bigint, INDEX_ integer, TO_LST_ID_ bigint, primary key (DBID_)) ENGINE=InnoDB;
create table NOVA_CS_INST_PROP (CS_ID_ bigint not null, VALUE_ longtext, QNAME_ varchar(255) not null, primary key (CS_ID_, QNAME_)) ENGINE=InnoDB;
create table NOVA_NAMESPACE (DBID_ bigint not null, URI_ varchar(255), PREFIX_ varchar(255), primary key (DBID_)) ENGINE=InnoDB;
create table ON_ALRM_DEF_ (DBID_ bigint not null, ON_ALRM_ACT_DEF_ID_ bigint, ON_ALRM_ACT_UUID_ varchar(500), FOR_EXPR_LANG_ varchar(255), FOR_DUR_LANG_ varchar(255), UNTIL_EXPR_LANG_ varchar(255), UNTIL_DEAD_LANG_ varchar(255), REPETE_EXPR_LANG_ varchar(255), REPEAT_DEAD_LANG_ varchar(255), SCOPE_ID_ bigint, INDEX_ integer, PK_DF_ON_AL_ID_ bigint, primary key (DBID_)) ENGINE=InnoDB;
create table ON_EVT_DEF_ (DBID_ bigint not null, PICK_VAR_ varchar(255), PICK_PART_LNK_ varchar(255), PICK_OPTN_ varchar(255), PICK_MSG_EXCHG_ varchar(255), PICK_PT_TP_QNAME_ varchar(255), ON_EVT_ACT_DEF_ID_ bigint, ON_EVT_ACT_UUID_ varchar(500), SCOPE_ID_ bigint, INDEX_ integer, primary key (DBID_)) ENGINE=InnoDB;
create table ON_MSG_DEF_ (DBID_ bigint not null, PICK_VAR_ varchar(255), PICK_PART_LNK_ varchar(255), PICK_OPTN_ varchar(255), PICK_MSG_EXCHG_ varchar(255), PICK_PT_TP_QNAME_ varchar(255), ON_MSG_ACT_DEF_ID_ bigint, ON_MSG_ACT_UUID_ varchar(500), PK_DF_ON_MSG_ID_ bigint, INDEX_ integer, primary key (DBID_)) ENGINE=InnoDB;
create table PART_LNK_DEF_ (DBID_ bigint not null, NAME_ varchar(255), MY_ROLE_ varchar(255), PARTNER_ROLE_ varchar(255), INIT_PRTN_ROLE_ bit, PRT_LNK_QNAME_ varchar(255), SCOPE_ID_ bigint, INDEX_ integer, primary key (DBID_)) ENGINE=InnoDB;
create table PLNK_UPDATE_FULL_IMPL (DBID_ bigint not null, ACT_INST_UUID_ varchar(255), DATE_ datetime, NAME_ varchar(255), P_END_REF longtext, PLNK_UPD_TYPE_ varchar(255), SCOPE_ID_ bigint, INDEX_ integer, primary key (DBID_)) ENGINE=InnoDB;
create table PROCESS_INST_STATE_UPDATE_ (DBID_ bigint not null, DATE_ datetime, STATE_ varchar(255), PROCESS_INST_ID_ bigint, INDEX_ integer, primary key (DBID_)) ENGINE=InnoDB;
create table SCOPE_STATE_UPDATE_ (DBID_ bigint not null, ACT_INST_UUID_ varchar(255), DATE_ datetime, STATE_ varchar(255), SCOPE_ID_ bigint, INDEX_ integer, primary key (DBID_)) ENGINE=InnoDB;
create table SRC_FULL_IMPL (DBID_ bigint not null, LNK_NAME varchar(255), TR_CND_EXP_LG varchar(255), TR_CND_BOL_EXP varchar(255), SRC_LST_ID_ bigint, INDEX_ integer, primary key (DBID_)) ENGINE=InnoDB;
create table TGT_FULL_IMPL (DBID_ bigint not null, LNK_NAME varchar(255), TRGT_LST_ID_ bigint, INDEX_ integer, primary key (DBID_)) ENGINE=InnoDB;
create table TO_PRT_DEF_ (DBID_ bigint not null, TP_PART_ varchar(255), TP_FRM_VAR_ varchar(255), IVK_TO_PT_ID_ bigint, INDEX_ integer, RP_TO_PT_ID_ bigint, primary key (DBID_)) ENGINE=InnoDB;
create table TR_COND_UPD_ (DBID_ bigint not null, STATUS_ bit, NAME_ varchar(255), DATE_ datetime, FLOW_ID_ bigint, INDEX_ integer, primary key (DBID_)) ENGINE=InnoDB;
create table VAR_DEF_ (DBID_ bigint not null, MSGTYPE_QNAME_ varchar(255), TYPE_QNAME_ varchar(255), ELT_QNAME_ varchar(255), NAME_ varchar(255), SCOPE_ID_ bigint, INDEX_ integer, primary key (DBID_)) ENGINE=InnoDB;
create table VAR_DEF_CS_ (DBID_ bigint not null, NAME_ varchar(255), SCOPE_ID_ bigint, INDEX_ integer, primary key (DBID_)) ENGINE=InnoDB;
create table VAR_UPDATE_FULL_IMPL (DBID_ bigint not null, ACT_INST_UUID_ varchar(255), DATE_ datetime, NAME_ varchar(255), IS_MESSAGE_ bit, VALUE_ longtext, INDEX_ integer, SCOPE_ID_ bigint, primary key (DBID_)) ENGINE=InnoDB;
create table WAITING_FULL_IMPL (DBID_ bigint not null, EXPECTED_STARTED_DATE_ datetime, PICK_ID_ bigint, INDEX_ integer, primary key (DBID_)) ENGINE=InnoDB;
create table linkList (FLOW_LINKS_ID_ bigint not null, FLOW_LINKS_ varchar(255), INDEX_ integer not null, primary key (FLOW_LINKS_ID_, INDEX_)) ENGINE=InnoDB;
create table messageExchanges (SCOPE_ID_ bigint not null, elt varchar(255), INDEX_ integer not null, primary key (SCOPE_ID_, INDEX_)) ENGINE=InnoDB;
create table properties (CORR_ST_DEF_ID_ bigint not null, PROP_QNAME_ varchar(255), INDEX_ integer not null, primary key (CORR_ST_DEF_ID_, INDEX_)) ENGINE=InnoDB;
create index ACT_INST_EXCEPTION_IDX on BPEL_ACTIVITY_INST (LAST_EXCEPTION_);
create index ACT_INST_PARENT_IDK on BPEL_ACTIVITY_INST (PARENT_ACT_INST_ID_);
create index SCOPE_INST_EVT_IDX on BPEL_ACTIVITY_INST (PARENT_SCOPE_ID_);
create index ACT_INST_CHILD_IDX on BPEL_ACTIVITY_INST (CHILD_ACT_INST_ID_);
create index ACT_PROC_INST_UUID_IDX on BPEL_ACTIVITY_INST (INST_UUID_);
create index ACT_INST_FH_IDX on BPEL_ACTIVITY_INST (FH_INST_);
create index ACT_INST_CH_IDX on BPEL_ACTIVITY_INST (CH_INST_);
create index ACT_INST_WAIT_IDX on BPEL_ACTIVITY_INST (CHILD_WAIT_ACT_);
create index ACT_INST_UUID_IDX on BPEL_ACTIVITY_INST (ACT_INST_UUID_);
create index ACT_INST_TH_IDX on BPEL_ACTIVITY_INST (TH_INST_);
alter table BPEL_ACTIVITY_INST add index ACT_INST_PARENT_FK (PARENT_ACT_INST_ID_), add constraint ACT_INST_PARENT_FK foreign key (PARENT_ACT_INST_ID_) references BPEL_ACTIVITY_INST (DBID_);
alter table BPEL_ACTIVITY_INST add index ACT_INST_CH_FK (CH_INST_), add constraint ACT_INST_CH_FK foreign key (CH_INST_) references BPEL_ACTIVITY_INST (DBID_);
alter table BPEL_ACTIVITY_INST add index ACT_INST_TH_FK (TH_INST_), add constraint ACT_INST_TH_FK foreign key (TH_INST_) references BPEL_ACTIVITY_INST (DBID_);
alter table BPEL_ACTIVITY_INST add index ACT_INST_FH_FK (FH_INST_), add constraint ACT_INST_FH_FK foreign key (FH_INST_) references BPEL_ACTIVITY_INST (DBID_);
alter table BPEL_ACTIVITY_INST add index ACT_INST_EXCEPTION_FK (LAST_EXCEPTION_), add constraint ACT_INST_EXCEPTION_FK foreign key (LAST_EXCEPTION_) references BPEL_FAULT_ (DBID_);
alter table BPEL_ACTIVITY_INST add index ACT_INST_WAIT_FK (CHILD_WAIT_ACT_), add constraint ACT_INST_WAIT_FK foreign key (CHILD_WAIT_ACT_) references WAITING_FULL_IMPL (DBID_);
alter table BPEL_ACTIVITY_INST add index ACT_INST_CHILD_FK (CHILD_ACT_INST_ID_), add constraint ACT_INST_CHILD_FK foreign key (CHILD_ACT_INST_ID_) references BPEL_ACTIVITY_INST (DBID_);
alter table BPEL_ACTIVITY_INST add index SCOPE_INST_EVT_FK (PARENT_SCOPE_ID_), add constraint SCOPE_INST_EVT_FK foreign key (PARENT_SCOPE_ID_) references BPEL_ACTIVITY_INST (DBID_);
create index SCOPE_DEF_FAULT_HANDLERS_IDX on BPEL_BASE_ACTIVITY_DEF (SCOPE_ID_);
alter table BPEL_BASE_ACTIVITY_DEF add index FK90444D19F1C5FAB0 (PARENT_ACT_DEF_ID_), add constraint FK90444D19F1C5FAB0 foreign key (PARENT_ACT_DEF_ID_) references BPEL_BASE_ACTIVITY_DEF (DBID_);
alter table BPEL_BASE_ACTIVITY_DEF add index FK90444D1982112BDD (CHILD_ACT_DEF_ID_), add constraint FK90444D1982112BDD foreign key (CHILD_ACT_DEF_ID_) references BPEL_BASE_ACTIVITY_DEF (DBID_);
alter table BPEL_BASE_ACTIVITY_DEF add index FK90444D19614874B5 (TERMINATION_HANDLER_), add constraint FK90444D19614874B5 foreign key (TERMINATION_HANDLER_) references BPEL_BASE_ACTIVITY_DEF (DBID_);
alter table BPEL_BASE_ACTIVITY_DEF add index FK90444D19DE3B31AF (COMPENSATION_HANDLER_), add constraint FK90444D19DE3B31AF foreign key (COMPENSATION_HANDLER_) references BPEL_BASE_ACTIVITY_DEF (DBID_);
alter table BPEL_BASE_ACTIVITY_DEF add index FK90444D19D4D0807A (ELSE_ACT_DEF_ID_), add constraint FK90444D19D4D0807A foreign key (ELSE_ACT_DEF_ID_) references BPEL_BASE_ACTIVITY_DEF (DBID_);
alter table BPEL_BASE_ACTIVITY_DEF add index SCOPE_DEF_FAULT_HANDLERS_FK (SCOPE_ID_), add constraint SCOPE_DEF_FAULT_HANDLERS_FK foreign key (SCOPE_ID_) references BPEL_BASE_ACTIVITY_DEF (DBID_);
create index IDX_REC_PROC_INST on BPEL_REC (INST_UUID_);
create index IDX_REC_ACT_INST on BPEL_REC (ACT_INST_UUID_);
create index IDX_REC_PROC_DEF on BPEL_REC (PROCESS_UUID_);
create index COPY_LST_IDX on COPY_FULL_IMPL (COPY_LST_ID_);
alter table COPY_FULL_IMPL add index COPY_LST_FK (COPY_LST_ID_), add constraint COPY_LST_FK foreign key (COPY_LST_ID_) references BPEL_BASE_ACTIVITY_DEF (DBID_);
create index RP_CR_DEF_LST_IDX on CORR_DEF_ (RP_CR_DEF_ID_);
create index IVK_CR_DEF_LST_IDX on CORR_DEF_ (IVK_CR_DEF_ID_);
create index ON_MSG_CORR_IDX on CORR_DEF_ (ON_MSG_CORR_ID_);
create index REC_CR_DEF_LST_IDX on CORR_DEF_ (REC_CR_DEF_ID_);
create index ON_EVT_CORR_IDX on CORR_DEF_ (ON_EVT_CORR_ID_);
alter table CORR_DEF_ add index REC_CR_DEF_LST_FK (REC_CR_DEF_ID_), add constraint REC_CR_DEF_LST_FK foreign key (REC_CR_DEF_ID_) references BPEL_BASE_ACTIVITY_DEF (DBID_);
alter table CORR_DEF_ add index IVK_CR_DEF_LST_FK (IVK_CR_DEF_ID_), add constraint IVK_CR_DEF_LST_FK foreign key (IVK_CR_DEF_ID_) references BPEL_BASE_ACTIVITY_DEF (DBID_);
alter table CORR_DEF_ add index RP_CR_DEF_LST_FK (RP_CR_DEF_ID_), add constraint RP_CR_DEF_LST_FK foreign key (RP_CR_DEF_ID_) references BPEL_BASE_ACTIVITY_DEF (DBID_);
alter table CORR_DEF_ add index ON_EVT_CORR_FK (ON_EVT_CORR_ID_), add constraint ON_EVT_CORR_FK foreign key (ON_EVT_CORR_ID_) references ON_EVT_DEF_ (DBID_);
alter table CORR_DEF_ add index ON_MSG_CORR_FK (ON_MSG_CORR_ID_), add constraint ON_MSG_CORR_FK foreign key (ON_MSG_CORR_ID_) references ON_MSG_DEF_ (DBID_);
create index SCOPE_INST_CS_IDX on CS_INIT_FULL_IMPL (SCOPE_ID_);
alter table CS_INIT_FULL_IMPL add index SCOPE_INST_CS_FK (SCOPE_ID_), add constraint SCOPE_INST_CS_FK foreign key (SCOPE_ID_) references BPEL_ACTIVITY_INST (DBID_);
create index IF_ELSEIF_LST_IDX on ELSEIF_DEF_ (IF_ELSEIF_LST_ID_);
alter table ELSEIF_DEF_ add index IF_ELSEIF_LST_FK (IF_ELSEIF_LST_ID_), add constraint IF_ELSEIF_LST_FK foreign key (IF_ELSEIF_LST_ID_) references BPEL_BASE_ACTIVITY_DEF (DBID_);
alter table ELSEIF_DEF_ add index FK4BC7A7A366DBBFD7 (ELSEIF_ACT_DEF_ID_), add constraint FK4BC7A7A366DBBFD7 foreign key (ELSEIF_ACT_DEF_ID_) references BPEL_BASE_ACTIVITY_DEF (DBID_);
create index IVK_FR_PT_LST_IDX on FRM_PRT_DEF_ (IVK_FR_PT_ID_);
create index ON_MSG_FRM_PRT_IDX on FRM_PRT_DEF_ (ON_MSG_FRM_PRT_ID_);
create index ON_EVT_FRM_PRT_IDX on FRM_PRT_DEF_ (ON_EVT_FRM_PRT_ID_);
create index REC_FR_PT_LST_IDX on FRM_PRT_DEF_ (REC_FR_PT_ID_);
alter table FRM_PRT_DEF_ add index REC_FR_PT_LST_FK (REC_FR_PT_ID_), add constraint REC_FR_PT_LST_FK foreign key (REC_FR_PT_ID_) references BPEL_BASE_ACTIVITY_DEF (DBID_);
alter table FRM_PRT_DEF_ add index IVK_FR_PT_LST_FK (IVK_FR_PT_ID_), add constraint IVK_FR_PT_LST_FK foreign key (IVK_FR_PT_ID_) references BPEL_BASE_ACTIVITY_DEF (DBID_);
alter table FRM_PRT_DEF_ add index ON_MSG_FRM_PRT_FK (ON_MSG_FRM_PRT_ID_), add constraint ON_MSG_FRM_PRT_FK foreign key (ON_MSG_FRM_PRT_ID_) references ON_MSG_DEF_ (DBID_);
alter table FRM_PRT_DEF_ add index ON_EVT_FRM_PRT_FK (ON_EVT_FRM_PRT_ID_), add constraint ON_EVT_FRM_PRT_FK foreign key (ON_EVT_FRM_PRT_ID_) references ON_EVT_DEF_ (DBID_);
create index TO_LST_IDX on FROM_TO_FULL (TO_LST_ID_);
create index FROM_LST_IDX on FROM_TO_FULL (FROM_LST_ID_);
alter table FROM_TO_FULL add index FROM_LST_FK (FROM_LST_ID_), add constraint FROM_LST_FK foreign key (FROM_LST_ID_) references COPY_FULL_IMPL (DBID_);
alter table FROM_TO_FULL add index TO_LST_FK (TO_LST_ID_), add constraint TO_LST_FK foreign key (TO_LST_ID_) references COPY_FULL_IMPL (DBID_);
create index CS_INST_PROP_IDX on NOVA_CS_INST_PROP (CS_ID_);
alter table NOVA_CS_INST_PROP add index CS_INST_PROP_FK (CS_ID_), add constraint CS_INST_PROP_FK foreign key (CS_ID_) references CS_INIT_FULL_IMPL (DBID_);
create index SCOPE_DEF_ALARMS_IDX on ON_ALRM_DEF_ (SCOPE_ID_);
create index PK_DF_ON_AL_IDX on ON_ALRM_DEF_ (PK_DF_ON_AL_ID_);
alter table ON_ALRM_DEF_ add index PK_DF_ON_AL_FK (PK_DF_ON_AL_ID_), add constraint PK_DF_ON_AL_FK foreign key (PK_DF_ON_AL_ID_) references BPEL_BASE_ACTIVITY_DEF (DBID_);
alter table ON_ALRM_DEF_ add index FK5B79CBB3735C61C7 (ON_ALRM_ACT_DEF_ID_), add constraint FK5B79CBB3735C61C7 foreign key (ON_ALRM_ACT_DEF_ID_) references BPEL_BASE_ACTIVITY_DEF (DBID_);
alter table ON_ALRM_DEF_ add index SCOPE_DEF_ALARMS_FK (SCOPE_ID_), add constraint SCOPE_DEF_ALARMS_FK foreign key (SCOPE_ID_) references BPEL_BASE_ACTIVITY_DEF (DBID_);
create index SCOPE_DEF_EVTS_IDX on ON_EVT_DEF_ (SCOPE_ID_);
alter table ON_EVT_DEF_ add index FKC013947699EA93C4 (ON_EVT_ACT_DEF_ID_), add constraint FKC013947699EA93C4 foreign key (ON_EVT_ACT_DEF_ID_) references BPEL_BASE_ACTIVITY_DEF (DBID_);
alter table ON_EVT_DEF_ add index SCOPE_DEF_EVTS_FK (SCOPE_ID_), add constraint SCOPE_DEF_EVTS_FK foreign key (SCOPE_ID_) references BPEL_BASE_ACTIVITY_DEF (DBID_);
create index PK_DF_ON_MSG_IDX on ON_MSG_DEF_ (PK_DF_ON_MSG_ID_);
alter table ON_MSG_DEF_ add index PK_DF_ON_MSG_FK (PK_DF_ON_MSG_ID_), add constraint PK_DF_ON_MSG_FK foreign key (PK_DF_ON_MSG_ID_) references BPEL_BASE_ACTIVITY_DEF (DBID_);
alter table ON_MSG_DEF_ add index FK4A3B4998A6853462 (ON_MSG_ACT_DEF_ID_), add constraint FK4A3B4998A6853462 foreign key (ON_MSG_ACT_DEF_ID_) references BPEL_BASE_ACTIVITY_DEF (DBID_);
create index SCOPE_DEF_PL_IDX on PART_LNK_DEF_ (SCOPE_ID_);
alter table PART_LNK_DEF_ add index SCOPE_DEF_PL_FK (SCOPE_ID_), add constraint SCOPE_DEF_PL_FK foreign key (SCOPE_ID_) references BPEL_BASE_ACTIVITY_DEF (DBID_);
create index SCOPE_INST_PLNK_IDX on PLNK_UPDATE_FULL_IMPL (SCOPE_ID_);
alter table PLNK_UPDATE_FULL_IMPL add index SCOPE_INST_PLNK_FK (SCOPE_ID_), add constraint SCOPE_INST_PLNK_FK foreign key (SCOPE_ID_) references BPEL_ACTIVITY_INST (DBID_);
create index PROCESS_INST_STATE_IDX on PROCESS_INST_STATE_UPDATE_ (PROCESS_INST_ID_);
alter table PROCESS_INST_STATE_UPDATE_ add index PROCESS_INST_STATE_FK (PROCESS_INST_ID_), add constraint PROCESS_INST_STATE_FK foreign key (PROCESS_INST_ID_) references BPEL_ACTIVITY_INST (DBID_);
create index SCOPE_INST_STATE_IDX on SCOPE_STATE_UPDATE_ (SCOPE_ID_);
alter table SCOPE_STATE_UPDATE_ add index SCOPE_INST_STATE_FK (SCOPE_ID_), add constraint SCOPE_INST_STATE_FK foreign key (SCOPE_ID_) references BPEL_ACTIVITY_INST (DBID_);
create index SRC_LST_IDX on SRC_FULL_IMPL (SRC_LST_ID_);
alter table SRC_FULL_IMPL add index SRC_LST_FK (SRC_LST_ID_), add constraint SRC_LST_FK foreign key (SRC_LST_ID_) references BPEL_BASE_ACTIVITY_DEF (DBID_);
create index TRGT_LST_IDX on TGT_FULL_IMPL (TRGT_LST_ID_);
alter table TGT_FULL_IMPL add index TRGT_LST_FK (TRGT_LST_ID_), add constraint TRGT_LST_FK foreign key (TRGT_LST_ID_) references BPEL_BASE_ACTIVITY_DEF (DBID_);
create index IVK_TO_PT_LST_IDX on TO_PRT_DEF_ (IVK_TO_PT_ID_);
create index RP_TO_PT_LST_IDX on TO_PRT_DEF_ (RP_TO_PT_ID_);
alter table TO_PRT_DEF_ add index RP_TO_PT_LST_FK (RP_TO_PT_ID_), add constraint RP_TO_PT_LST_FK foreign key (RP_TO_PT_ID_) references BPEL_BASE_ACTIVITY_DEF (DBID_);
alter table TO_PRT_DEF_ add index IVK_TO_PT_LST_FK (IVK_TO_PT_ID_), add constraint IVK_TO_PT_LST_FK foreign key (IVK_TO_PT_ID_) references BPEL_BASE_ACTIVITY_DEF (DBID_);
create index FLOW_INST_TR_COND_IDX on TR_COND_UPD_ (FLOW_ID_);
alter table TR_COND_UPD_ add index FLOW_INST_TR_COND_FK (FLOW_ID_), add constraint FLOW_INST_TR_COND_FK foreign key (FLOW_ID_) references BPEL_ACTIVITY_INST (DBID_);
create index SCOPE_DEF_VAR_IDX on VAR_DEF_ (SCOPE_ID_);
alter table VAR_DEF_ add index SCOPE_DEF_VAR_FK (SCOPE_ID_), add constraint SCOPE_DEF_VAR_FK foreign key (SCOPE_ID_) references BPEL_BASE_ACTIVITY_DEF (DBID_);
create index SCOPE_DEF_CS_IDX on VAR_DEF_CS_ (SCOPE_ID_);
alter table VAR_DEF_CS_ add index SCOPE_DEF_CS_FK (SCOPE_ID_), add constraint SCOPE_DEF_CS_FK foreign key (SCOPE_ID_) references BPEL_BASE_ACTIVITY_DEF (DBID_);
create index SCOPE_INST_VAR_IDX on VAR_UPDATE_FULL_IMPL (SCOPE_ID_);
alter table VAR_UPDATE_FULL_IMPL add index SCOPE_INST_VAR_FK (SCOPE_ID_), add constraint SCOPE_INST_VAR_FK foreign key (SCOPE_ID_) references BPEL_ACTIVITY_INST (DBID_);
create index PICK_WAIT_IDX on WAITING_FULL_IMPL (PICK_ID_);
alter table WAITING_FULL_IMPL add index PICK_WAIT_FK (PICK_ID_), add constraint PICK_WAIT_FK foreign key (PICK_ID_) references BPEL_ACTIVITY_INST (DBID_);
create index FLOW_LINKS_IDX on linkList (FLOW_LINKS_ID_);
alter table linkList add index FLOW_LINKS_FK (FLOW_LINKS_ID_), add constraint FLOW_LINKS_FK foreign key (FLOW_LINKS_ID_) references BPEL_BASE_ACTIVITY_DEF (DBID_);
create index SCOPE_DEF_M_E_IDX on messageExchanges (SCOPE_ID_);
alter table messageExchanges add index SCOPE_DEF_M_E_FK (SCOPE_ID_), add constraint SCOPE_DEF_M_E_FK foreign key (SCOPE_ID_) references BPEL_BASE_ACTIVITY_DEF (DBID_);
create index CORR_ST_DEF_IDX on properties (CORR_ST_DEF_ID_);
alter table properties add index CORR_ST_DEF_FK (CORR_ST_DEF_ID_), add constraint CORR_ST_DEF_FK foreign key (CORR_ST_DEF_ID_) references VAR_DEF_CS_ (DBID_);
create table orchestra_sequences ( sequence_name varchar(255) not null ,  next_val bigint, primary key ( sequence_name ) )  ENGINE=InnoDB;
