activiti.db2.create.history.sql 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156
  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_ timestamp not null,
  7. END_TIME_ timestamp,
  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. );
  18. alter table ACT_HI_PROCINST add constraint PROC_INST_ID_ unique(PROC_INST_ID_);
  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. OWNER_ varchar(64),
  30. ASSIGNEE_ varchar(255),
  31. START_TIME_ timestamp not null,
  32. END_TIME_ timestamp,
  33. DURATION_ bigint,
  34. TENANT_ID_ varchar(255) default '',
  35. primary key (ID_)
  36. );
  37. create table ACT_HI_TASKINST (
  38. ID_ varchar(64) not null,
  39. PROC_DEF_ID_ varchar(64),
  40. TASK_DEF_KEY_ varchar(255),
  41. PROC_INST_ID_ varchar(64),
  42. EXECUTION_ID_ varchar(64),
  43. NAME_ varchar(255),
  44. PARENT_TASK_ID_ varchar(64),
  45. DESCRIPTION_ varchar(4000),
  46. OWNER_ varchar(255),
  47. ASSIGNEE_ varchar(255),
  48. START_TIME_ timestamp not null,
  49. CLAIM_TIME_ timestamp,
  50. END_TIME_ timestamp,
  51. DURATION_ bigint,
  52. DELETE_REASON_ varchar(4000),
  53. PRIORITY_ integer,
  54. DUE_DATE_ timestamp,
  55. FORM_KEY_ varchar(255),
  56. CATEGORY_ varchar(255),
  57. TENANT_ID_ varchar(255) default '',
  58. primary key (ID_)
  59. );
  60. create table ACT_HI_VARINST (
  61. ID_ varchar(64) not null,
  62. PROC_INST_ID_ varchar(64),
  63. EXECUTION_ID_ varchar(64),
  64. TASK_ID_ varchar(64),
  65. NAME_ varchar(255) not null,
  66. VAR_TYPE_ varchar(100),
  67. REV_ integer,
  68. BYTEARRAY_ID_ varchar(64),
  69. DOUBLE_ double precision,
  70. LONG_ bigint,
  71. TEXT_ varchar(4000),
  72. TEXT2_ varchar(4000),
  73. CREATE_TIME_ timestamp,
  74. LAST_UPDATED_TIME_ timestamp,
  75. primary key (ID_)
  76. );
  77. create table ACT_HI_DETAIL (
  78. ID_ varchar(64) not null,
  79. TYPE_ varchar(255) not null,
  80. PROC_INST_ID_ varchar(64),
  81. EXECUTION_ID_ varchar(64),
  82. TASK_ID_ varchar(64),
  83. ACT_INST_ID_ varchar(64),
  84. NAME_ varchar(255) not null,
  85. VAR_TYPE_ varchar(255),
  86. REV_ integer,
  87. TIME_ timestamp not null,
  88. BYTEARRAY_ID_ varchar(64),
  89. DOUBLE_ double precision,
  90. LONG_ bigint,
  91. TEXT_ varchar(4000),
  92. TEXT2_ varchar(4000),
  93. primary key (ID_)
  94. );
  95. create table ACT_HI_COMMENT (
  96. ID_ varchar(64) not null,
  97. TYPE_ varchar(255),
  98. TIME_ timestamp not null,
  99. USER_ID_ varchar(255),
  100. TASK_ID_ varchar(64),
  101. PROC_INST_ID_ varchar(64),
  102. ACTION_ varchar(255),
  103. MESSAGE_ varchar(4000),
  104. FULL_MSG_ BLOB,
  105. primary key (ID_)
  106. );
  107. create table ACT_HI_ATTACHMENT (
  108. ID_ varchar(64) not null,
  109. REV_ integer,
  110. USER_ID_ varchar(255),
  111. NAME_ varchar(255),
  112. DESCRIPTION_ varchar(4000),
  113. TYPE_ varchar(255),
  114. TASK_ID_ varchar(64),
  115. PROC_INST_ID_ varchar(64),
  116. URL_ varchar(4000),
  117. CONTENT_ID_ varchar(64),
  118. TIME_ timestamp,
  119. primary key (ID_)
  120. );
  121. create table ACT_HI_IDENTITYLINK (
  122. ID_ varchar(64) not null,
  123. GROUP_ID_ varchar(255),
  124. TYPE_ varchar(255),
  125. USER_ID_ varchar(255),
  126. TASK_ID_ varchar(64),
  127. PROC_INST_ID_ varchar(64),
  128. primary key (ID_)
  129. );
  130. create index ACT_IDX_HI_PRO_INST_END on ACT_HI_PROCINST(END_TIME_);
  131. create index ACT_IDX_HI_PRO_I_BUSKEY on ACT_HI_PROCINST(BUSINESS_KEY_);
  132. create index ACT_IDX_HI_ACT_INST_START on ACT_HI_ACTINST(START_TIME_);
  133. create index ACT_IDX_HI_ACT_INST_END on ACT_HI_ACTINST(END_TIME_);
  134. create index ACT_IDX_HI_DETAIL_PROC_INST on ACT_HI_DETAIL(PROC_INST_ID_);
  135. create index ACT_IDX_HI_DETAIL_ACT_INST on ACT_HI_DETAIL(ACT_INST_ID_);
  136. create index ACT_IDX_HI_DETAIL_TIME on ACT_HI_DETAIL(TIME_);
  137. create index ACT_IDX_HI_DETAIL_NAME on ACT_HI_DETAIL(NAME_);
  138. create index ACT_IDX_HI_DETAIL_TASK_ID on ACT_HI_DETAIL(TASK_ID_);
  139. create index ACT_IDX_HI_PROCVAR_PROC_INST on ACT_HI_VARINST(PROC_INST_ID_);
  140. create index ACT_IDX_HI_PROCVAR_NAME_TYPE on ACT_HI_VARINST(NAME_, VAR_TYPE_);
  141. create index ACT_IDX_HI_PROCVAR_TASK_ID on ACT_HI_VARINST(TASK_ID_);
  142. create index ACT_IDX_HI_ACT_INST_PROCINST on ACT_HI_ACTINST(PROC_INST_ID_, ACT_ID_);
  143. create index ACT_IDX_HI_ACT_INST_EXEC on ACT_HI_ACTINST(EXECUTION_ID_, ACT_ID_);
  144. create index ACT_IDX_HI_IDENT_LNK_USER on ACT_HI_IDENTITYLINK(USER_ID_);
  145. create index ACT_IDX_HI_IDENT_LNK_TASK on ACT_HI_IDENTITYLINK(TASK_ID_);
  146. create index ACT_IDX_HI_IDENT_LNK_PROCINST on ACT_HI_IDENTITYLINK(PROC_INST_ID_);
  147. create index ACT_IDX_HI_TASK_INST_PROCINST on ACT_HI_TASKINST(PROC_INST_ID_);