activiti.mysql55.create.history.sql 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155
  1. create table ACT_HI_PROCINST (
  2. ID_ varchar(64) not null,
  3. PROC_INST_ID_ varchar(64) not null,
  4. BUSINESS_KEY_ varchar(255),
  5. PROC_DEF_ID_ varchar(64) not null,
  6. START_TIME_ datetime not null,
  7. END_TIME_ datetime,
  8. DURATION_ bigint,
  9. START_USER_ID_ varchar(255),
  10. START_ACT_ID_ varchar(255),
  11. END_ACT_ID_ varchar(255),
  12. SUPER_PROCESS_INSTANCE_ID_ varchar(64),
  13. DELETE_REASON_ varchar(4000),
  14. TENANT_ID_ varchar(255) default '',
  15. NAME_ varchar(255),
  16. primary key (ID_),
  17. unique (PROC_INST_ID_)
  18. ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE utf8_bin;
  19. create table ACT_HI_ACTINST (
  20. ID_ varchar(64) not null,
  21. PROC_DEF_ID_ varchar(64) not null,
  22. PROC_INST_ID_ varchar(64) not null,
  23. EXECUTION_ID_ varchar(64) not null,
  24. ACT_ID_ varchar(255) not null,
  25. TASK_ID_ varchar(64),
  26. CALL_PROC_INST_ID_ varchar(64),
  27. ACT_NAME_ varchar(255),
  28. ACT_TYPE_ varchar(255) not null,
  29. ASSIGNEE_ varchar(255),
  30. START_TIME_ datetime not null,
  31. END_TIME_ datetime,
  32. DURATION_ bigint,
  33. TENANT_ID_ varchar(255) default '',
  34. primary key (ID_)
  35. ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE utf8_bin;
  36. create table ACT_HI_TASKINST (
  37. ID_ varchar(64) not null,
  38. PROC_DEF_ID_ varchar(64),
  39. TASK_DEF_KEY_ varchar(255),
  40. PROC_INST_ID_ varchar(64),
  41. EXECUTION_ID_ varchar(64),
  42. NAME_ varchar(255),
  43. PARENT_TASK_ID_ varchar(64),
  44. DESCRIPTION_ varchar(4000),
  45. OWNER_ varchar(255),
  46. ASSIGNEE_ varchar(255),
  47. START_TIME_ datetime not null,
  48. CLAIM_TIME_ datetime,
  49. END_TIME_ datetime,
  50. DURATION_ bigint,
  51. DELETE_REASON_ varchar(4000),
  52. PRIORITY_ integer,
  53. DUE_DATE_ datetime,
  54. FORM_KEY_ varchar(255),
  55. CATEGORY_ varchar(255),
  56. TENANT_ID_ varchar(255) default '',
  57. primary key (ID_)
  58. ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE utf8_bin;
  59. create table ACT_HI_VARINST (
  60. ID_ varchar(64) not null,
  61. PROC_INST_ID_ varchar(64),
  62. EXECUTION_ID_ varchar(64),
  63. TASK_ID_ varchar(64),
  64. NAME_ varchar(255) not null,
  65. VAR_TYPE_ varchar(100),
  66. REV_ integer,
  67. BYTEARRAY_ID_ varchar(64),
  68. DOUBLE_ double,
  69. LONG_ bigint,
  70. TEXT_ varchar(4000),
  71. TEXT2_ varchar(4000),
  72. CREATE_TIME_ datetime,
  73. LAST_UPDATED_TIME_ datetime,
  74. primary key (ID_)
  75. ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE utf8_bin;
  76. create table ACT_HI_DETAIL (
  77. ID_ varchar(64) not null,
  78. TYPE_ varchar(255) not null,
  79. PROC_INST_ID_ varchar(64),
  80. EXECUTION_ID_ varchar(64),
  81. TASK_ID_ varchar(64),
  82. ACT_INST_ID_ varchar(64),
  83. NAME_ varchar(255) not null,
  84. VAR_TYPE_ varchar(255),
  85. REV_ integer,
  86. TIME_ datetime not null,
  87. BYTEARRAY_ID_ varchar(64),
  88. DOUBLE_ double,
  89. LONG_ bigint,
  90. TEXT_ varchar(4000),
  91. TEXT2_ varchar(4000),
  92. primary key (ID_)
  93. ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE utf8_bin;
  94. create table ACT_HI_COMMENT (
  95. ID_ varchar(64) not null,
  96. TYPE_ varchar(255),
  97. TIME_ datetime not null,
  98. USER_ID_ varchar(255),
  99. TASK_ID_ varchar(64),
  100. PROC_INST_ID_ varchar(64),
  101. ACTION_ varchar(255),
  102. MESSAGE_ varchar(4000),
  103. FULL_MSG_ LONGBLOB,
  104. primary key (ID_)
  105. ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE utf8_bin;
  106. create table ACT_HI_ATTACHMENT (
  107. ID_ varchar(64) not null,
  108. REV_ integer,
  109. USER_ID_ varchar(255),
  110. NAME_ varchar(255),
  111. DESCRIPTION_ varchar(4000),
  112. TYPE_ varchar(255),
  113. TASK_ID_ varchar(64),
  114. PROC_INST_ID_ varchar(64),
  115. URL_ varchar(4000),
  116. CONTENT_ID_ varchar(64),
  117. TIME_ datetime,
  118. primary key (ID_)
  119. ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE utf8_bin;
  120. create table ACT_HI_IDENTITYLINK (
  121. ID_ varchar(64),
  122. GROUP_ID_ varchar(255),
  123. TYPE_ varchar(255),
  124. USER_ID_ varchar(255),
  125. TASK_ID_ varchar(64),
  126. PROC_INST_ID_ varchar(64),
  127. primary key (ID_)
  128. ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE utf8_bin;
  129. create index ACT_IDX_HI_PRO_INST_END on ACT_HI_PROCINST(END_TIME_);
  130. create index ACT_IDX_HI_PRO_I_BUSKEY on ACT_HI_PROCINST(BUSINESS_KEY_);
  131. create index ACT_IDX_HI_ACT_INST_START on ACT_HI_ACTINST(START_TIME_);
  132. create index ACT_IDX_HI_ACT_INST_END on ACT_HI_ACTINST(END_TIME_);
  133. create index ACT_IDX_HI_DETAIL_PROC_INST on ACT_HI_DETAIL(PROC_INST_ID_);
  134. create index ACT_IDX_HI_DETAIL_ACT_INST on ACT_HI_DETAIL(ACT_INST_ID_);
  135. create index ACT_IDX_HI_DETAIL_TIME on ACT_HI_DETAIL(TIME_);
  136. create index ACT_IDX_HI_DETAIL_NAME on ACT_HI_DETAIL(NAME_);
  137. create index ACT_IDX_HI_DETAIL_TASK_ID on ACT_HI_DETAIL(TASK_ID_);
  138. create index ACT_IDX_HI_PROCVAR_PROC_INST on ACT_HI_VARINST(PROC_INST_ID_);
  139. create index ACT_IDX_HI_PROCVAR_NAME_TYPE on ACT_HI_VARINST(NAME_, VAR_TYPE_);
  140. create index ACT_IDX_HI_PROCVAR_TASK_ID on ACT_HI_VARINST(TASK_ID_);
  141. create index ACT_IDX_HI_ACT_INST_PROCINST on ACT_HI_ACTINST(PROC_INST_ID_, ACT_ID_);
  142. create index ACT_IDX_HI_ACT_INST_EXEC on ACT_HI_ACTINST(EXECUTION_ID_, ACT_ID_);
  143. create index ACT_IDX_HI_IDENT_LNK_USER on ACT_HI_IDENTITYLINK(USER_ID_);
  144. create index ACT_IDX_HI_IDENT_LNK_TASK on ACT_HI_IDENTITYLINK(TASK_ID_);
  145. create index ACT_IDX_HI_IDENT_LNK_PROCINST on ACT_HI_IDENTITYLINK(PROC_INST_ID_);
  146. create index ACT_IDX_HI_TASK_INST_PROCINST on ACT_HI_TASKINST(PROC_INST_ID_);