oracle.sql 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552
  1. create table ACT_GE_PROPERTY (
  2. NAME_ NVARCHAR2(64),
  3. VALUE_ NVARCHAR2(300),
  4. REV_ INTEGER,
  5. primary key (NAME_)
  6. );
  7. insert into ACT_GE_PROPERTY
  8. values ('schema.version', '5.22.0.0', 1);
  9. insert into ACT_GE_PROPERTY
  10. values ('schema.history', 'create(5.22.0.0)', 1);
  11. insert into ACT_GE_PROPERTY
  12. values ('next.dbid', '1', 1);
  13. create table ACT_GE_BYTEARRAY (
  14. ID_ NVARCHAR2(64),
  15. REV_ INTEGER,
  16. NAME_ NVARCHAR2(255),
  17. DEPLOYMENT_ID_ NVARCHAR2(64),
  18. BYTES_ BLOB,
  19. GENERATED_ NUMBER(1,0) CHECK (GENERATED_ IN (1,0)),
  20. primary key (ID_)
  21. );
  22. create table ACT_RE_DEPLOYMENT (
  23. ID_ NVARCHAR2(64),
  24. NAME_ NVARCHAR2(255),
  25. CATEGORY_ NVARCHAR2(255),
  26. TENANT_ID_ NVARCHAR2(255) DEFAULT '',
  27. DEPLOY_TIME_ TIMESTAMP(6),
  28. primary key (ID_)
  29. );
  30. create table ACT_RE_MODEL (
  31. ID_ NVARCHAR2(64) not null,
  32. REV_ INTEGER,
  33. NAME_ NVARCHAR2(255),
  34. KEY_ NVARCHAR2(255),
  35. CATEGORY_ NVARCHAR2(255),
  36. CREATE_TIME_ TIMESTAMP(6),
  37. LAST_UPDATE_TIME_ TIMESTAMP(6),
  38. VERSION_ INTEGER,
  39. META_INFO_ NVARCHAR2(2000),
  40. DEPLOYMENT_ID_ NVARCHAR2(64),
  41. EDITOR_SOURCE_VALUE_ID_ NVARCHAR2(64),
  42. EDITOR_SOURCE_EXTRA_VALUE_ID_ NVARCHAR2(64),
  43. TENANT_ID_ NVARCHAR2(255) DEFAULT '',
  44. primary key (ID_)
  45. );
  46. create table ACT_RU_EXECUTION (
  47. ID_ NVARCHAR2(64),
  48. REV_ INTEGER,
  49. PROC_INST_ID_ NVARCHAR2(64),
  50. BUSINESS_KEY_ NVARCHAR2(255),
  51. PARENT_ID_ NVARCHAR2(64),
  52. PROC_DEF_ID_ NVARCHAR2(64),
  53. SUPER_EXEC_ NVARCHAR2(64),
  54. ACT_ID_ NVARCHAR2(255),
  55. IS_ACTIVE_ NUMBER(1,0) CHECK (IS_ACTIVE_ IN (1,0)),
  56. IS_CONCURRENT_ NUMBER(1,0) CHECK (IS_CONCURRENT_ IN (1,0)),
  57. IS_SCOPE_ NUMBER(1,0) CHECK (IS_SCOPE_ IN (1,0)),
  58. IS_EVENT_SCOPE_ NUMBER(1,0) CHECK (IS_EVENT_SCOPE_ IN (1,0)),
  59. SUSPENSION_STATE_ INTEGER,
  60. CACHED_ENT_STATE_ INTEGER,
  61. TENANT_ID_ NVARCHAR2(255) DEFAULT '',
  62. NAME_ NVARCHAR2(255),
  63. LOCK_TIME_ TIMESTAMP(6),
  64. primary key (ID_)
  65. );
  66. create table ACT_RU_JOB (
  67. ID_ NVARCHAR2(64) NOT NULL,
  68. REV_ INTEGER,
  69. TYPE_ NVARCHAR2(255) NOT NULL,
  70. LOCK_EXP_TIME_ TIMESTAMP(6),
  71. LOCK_OWNER_ NVARCHAR2(255),
  72. EXCLUSIVE_ NUMBER(1,0) CHECK (EXCLUSIVE_ IN (1,0)),
  73. EXECUTION_ID_ NVARCHAR2(64),
  74. PROCESS_INSTANCE_ID_ NVARCHAR2(64),
  75. PROC_DEF_ID_ NVARCHAR2(64),
  76. RETRIES_ INTEGER,
  77. EXCEPTION_STACK_ID_ NVARCHAR2(64),
  78. EXCEPTION_MSG_ NVARCHAR2(2000),
  79. DUEDATE_ TIMESTAMP(6),
  80. REPEAT_ NVARCHAR2(255),
  81. HANDLER_TYPE_ NVARCHAR2(255),
  82. HANDLER_CFG_ NVARCHAR2(2000),
  83. TENANT_ID_ NVARCHAR2(255) DEFAULT '',
  84. primary key (ID_)
  85. );
  86. create table ACT_RE_PROCDEF (
  87. ID_ NVARCHAR2(64) NOT NULL,
  88. REV_ INTEGER,
  89. CATEGORY_ NVARCHAR2(255),
  90. NAME_ NVARCHAR2(255),
  91. KEY_ NVARCHAR2(255) NOT NULL,
  92. VERSION_ INTEGER NOT NULL,
  93. DEPLOYMENT_ID_ NVARCHAR2(64),
  94. RESOURCE_NAME_ NVARCHAR2(2000),
  95. DGRM_RESOURCE_NAME_ varchar(4000),
  96. DESCRIPTION_ NVARCHAR2(2000),
  97. HAS_START_FORM_KEY_ NUMBER(1,0) CHECK (HAS_START_FORM_KEY_ IN (1,0)),
  98. HAS_GRAPHICAL_NOTATION_ NUMBER(1,0) CHECK (HAS_GRAPHICAL_NOTATION_ IN (1,0)),
  99. SUSPENSION_STATE_ INTEGER,
  100. TENANT_ID_ NVARCHAR2(255) DEFAULT '',
  101. primary key (ID_)
  102. );
  103. create table ACT_RU_TASK (
  104. ID_ NVARCHAR2(64),
  105. REV_ INTEGER,
  106. EXECUTION_ID_ NVARCHAR2(64),
  107. PROC_INST_ID_ NVARCHAR2(64),
  108. PROC_DEF_ID_ NVARCHAR2(64),
  109. NAME_ NVARCHAR2(255),
  110. PARENT_TASK_ID_ NVARCHAR2(64),
  111. DESCRIPTION_ NVARCHAR2(2000),
  112. TASK_DEF_KEY_ NVARCHAR2(255),
  113. OWNER_ NVARCHAR2(255),
  114. ASSIGNEE_ NVARCHAR2(255),
  115. DELEGATION_ NVARCHAR2(64),
  116. PRIORITY_ INTEGER,
  117. CREATE_TIME_ TIMESTAMP(6),
  118. DUE_DATE_ TIMESTAMP(6),
  119. CATEGORY_ NVARCHAR2(255),
  120. SUSPENSION_STATE_ INTEGER,
  121. TENANT_ID_ NVARCHAR2(255) DEFAULT '',
  122. FORM_KEY_ NVARCHAR2(255),
  123. primary key (ID_)
  124. );
  125. create table ACT_RU_IDENTITYLINK (
  126. ID_ NVARCHAR2(64),
  127. REV_ INTEGER,
  128. GROUP_ID_ NVARCHAR2(255),
  129. TYPE_ NVARCHAR2(255),
  130. USER_ID_ NVARCHAR2(255),
  131. TASK_ID_ NVARCHAR2(64),
  132. PROC_INST_ID_ NVARCHAR2(64),
  133. PROC_DEF_ID_ NVARCHAR2(64),
  134. primary key (ID_)
  135. );
  136. create table ACT_RU_VARIABLE (
  137. ID_ NVARCHAR2(64) not null,
  138. REV_ INTEGER,
  139. TYPE_ NVARCHAR2(255) not null,
  140. NAME_ NVARCHAR2(255) not null,
  141. EXECUTION_ID_ NVARCHAR2(64),
  142. PROC_INST_ID_ NVARCHAR2(64),
  143. TASK_ID_ NVARCHAR2(64),
  144. BYTEARRAY_ID_ NVARCHAR2(64),
  145. DOUBLE_ NUMBER(*,10),
  146. LONG_ NUMBER(19,0),
  147. TEXT_ NVARCHAR2(2000),
  148. TEXT2_ NVARCHAR2(2000),
  149. primary key (ID_)
  150. );
  151. create table ACT_RU_EVENT_SUBSCR (
  152. ID_ NVARCHAR2(64) not null,
  153. REV_ integer,
  154. EVENT_TYPE_ NVARCHAR2(255) not null,
  155. EVENT_NAME_ NVARCHAR2(255),
  156. EXECUTION_ID_ NVARCHAR2(64),
  157. PROC_INST_ID_ NVARCHAR2(64),
  158. ACTIVITY_ID_ NVARCHAR2(64),
  159. CONFIGURATION_ NVARCHAR2(255),
  160. CREATED_ TIMESTAMP(6) not null,
  161. PROC_DEF_ID_ NVARCHAR2(64),
  162. TENANT_ID_ NVARCHAR2(255) DEFAULT '',
  163. primary key (ID_)
  164. );
  165. create table ACT_EVT_LOG (
  166. LOG_NR_ NUMBER(19),
  167. TYPE_ NVARCHAR2(64),
  168. PROC_DEF_ID_ NVARCHAR2(64),
  169. PROC_INST_ID_ NVARCHAR2(64),
  170. EXECUTION_ID_ NVARCHAR2(64),
  171. TASK_ID_ NVARCHAR2(64),
  172. TIME_STAMP_ TIMESTAMP(6) not null,
  173. USER_ID_ NVARCHAR2(255),
  174. DATA_ BLOB,
  175. LOCK_OWNER_ NVARCHAR2(255),
  176. LOCK_TIME_ TIMESTAMP(6) null,
  177. IS_PROCESSED_ NUMBER(3) default 0,
  178. primary key (LOG_NR_)
  179. );
  180. create sequence act_evt_log_seq;
  181. create table ACT_PROCDEF_INFO (
  182. ID_ NVARCHAR2(64) not null,
  183. PROC_DEF_ID_ NVARCHAR2(64) not null,
  184. REV_ integer,
  185. INFO_JSON_ID_ NVARCHAR2(64),
  186. primary key (ID_)
  187. );
  188. create index ACT_IDX_EXEC_BUSKEY on ACT_RU_EXECUTION(BUSINESS_KEY_);
  189. create index ACT_IDX_TASK_CREATE on ACT_RU_TASK(CREATE_TIME_);
  190. create index ACT_IDX_IDENT_LNK_USER on ACT_RU_IDENTITYLINK(USER_ID_);
  191. create index ACT_IDX_IDENT_LNK_GROUP on ACT_RU_IDENTITYLINK(GROUP_ID_);
  192. create index ACT_IDX_EVENT_SUBSCR_CONFIG_ on ACT_RU_EVENT_SUBSCR(CONFIGURATION_);
  193. create index ACT_IDX_VARIABLE_TASK_ID on ACT_RU_VARIABLE(TASK_ID_);
  194. create index ACT_IDX_BYTEAR_DEPL on ACT_GE_BYTEARRAY(DEPLOYMENT_ID_);
  195. alter table ACT_GE_BYTEARRAY
  196. add constraint ACT_FK_BYTEARR_DEPL
  197. foreign key (DEPLOYMENT_ID_)
  198. references ACT_RE_DEPLOYMENT (ID_);
  199. alter table ACT_RE_PROCDEF
  200. add constraint ACT_UNIQ_PROCDEF
  201. unique (KEY_,VERSION_, TENANT_ID_);
  202. create index ACT_IDX_EXE_PROCINST on ACT_RU_EXECUTION(PROC_INST_ID_);
  203. alter table ACT_RU_EXECUTION
  204. add constraint ACT_FK_EXE_PROCINST
  205. foreign key (PROC_INST_ID_)
  206. references ACT_RU_EXECUTION (ID_);
  207. create index ACT_IDX_EXE_PARENT on ACT_RU_EXECUTION(PARENT_ID_);
  208. alter table ACT_RU_EXECUTION
  209. add constraint ACT_FK_EXE_PARENT
  210. foreign key (PARENT_ID_)
  211. references ACT_RU_EXECUTION (ID_);
  212. create index ACT_IDX_EXE_SUPER on ACT_RU_EXECUTION(SUPER_EXEC_);
  213. alter table ACT_RU_EXECUTION
  214. add constraint ACT_FK_EXE_SUPER
  215. foreign key (SUPER_EXEC_)
  216. references ACT_RU_EXECUTION (ID_);
  217. create index ACT_IDX_EXE_PROCDEF on ACT_RU_EXECUTION(PROC_DEF_ID_);
  218. alter table ACT_RU_EXECUTION
  219. add constraint ACT_FK_EXE_PROCDEF
  220. foreign key (PROC_DEF_ID_)
  221. references ACT_RE_PROCDEF (ID_);
  222. create index ACT_IDX_TSKASS_TASK on ACT_RU_IDENTITYLINK(TASK_ID_);
  223. alter table ACT_RU_IDENTITYLINK
  224. add constraint ACT_FK_TSKASS_TASK
  225. foreign key (TASK_ID_)
  226. references ACT_RU_TASK (ID_);
  227. create index ACT_IDX_ATHRZ_PROCEDEF on ACT_RU_IDENTITYLINK(PROC_DEF_ID_);
  228. alter table ACT_RU_IDENTITYLINK
  229. add constraint ACT_FK_ATHRZ_PROCEDEF
  230. foreign key (PROC_DEF_ID_)
  231. references ACT_RE_PROCDEF (ID_);
  232. create index ACT_IDX_IDL_PROCINST on ACT_RU_IDENTITYLINK(PROC_INST_ID_);
  233. alter table ACT_RU_IDENTITYLINK
  234. add constraint ACT_FK_IDL_PROCINST
  235. foreign key (PROC_INST_ID_)
  236. references ACT_RU_EXECUTION (ID_);
  237. create index ACT_IDX_TASK_EXEC on ACT_RU_TASK(EXECUTION_ID_);
  238. alter table ACT_RU_TASK
  239. add constraint ACT_FK_TASK_EXE
  240. foreign key (EXECUTION_ID_)
  241. references ACT_RU_EXECUTION (ID_);
  242. create index ACT_IDX_TASK_PROCINST on ACT_RU_TASK(PROC_INST_ID_);
  243. alter table ACT_RU_TASK
  244. add constraint ACT_FK_TASK_PROCINST
  245. foreign key (PROC_INST_ID_)
  246. references ACT_RU_EXECUTION (ID_);
  247. create index ACT_IDX_TASK_PROCDEF on ACT_RU_TASK(PROC_DEF_ID_);
  248. alter table ACT_RU_TASK
  249. add constraint ACT_FK_TASK_PROCDEF
  250. foreign key (PROC_DEF_ID_)
  251. references ACT_RE_PROCDEF (ID_);
  252. create index ACT_IDX_VAR_EXE on ACT_RU_VARIABLE(EXECUTION_ID_);
  253. alter table ACT_RU_VARIABLE
  254. add constraint ACT_FK_VAR_EXE
  255. foreign key (EXECUTION_ID_)
  256. references ACT_RU_EXECUTION (ID_);
  257. create index ACT_IDX_VAR_PROCINST on ACT_RU_VARIABLE(PROC_INST_ID_);
  258. alter table ACT_RU_VARIABLE
  259. add constraint ACT_FK_VAR_PROCINST
  260. foreign key (PROC_INST_ID_)
  261. references ACT_RU_EXECUTION(ID_);
  262. create index ACT_IDX_VAR_BYTEARRAY on ACT_RU_VARIABLE(BYTEARRAY_ID_);
  263. alter table ACT_RU_VARIABLE
  264. add constraint ACT_FK_VAR_BYTEARRAY
  265. foreign key (BYTEARRAY_ID_)
  266. references ACT_GE_BYTEARRAY (ID_);
  267. create index ACT_IDX_JOB_EXCEPTION on ACT_RU_JOB(EXCEPTION_STACK_ID_);
  268. alter table ACT_RU_JOB
  269. add constraint ACT_FK_JOB_EXCEPTION
  270. foreign key (EXCEPTION_STACK_ID_)
  271. references ACT_GE_BYTEARRAY (ID_);
  272. create index ACT_IDX_EVENT_SUBSCR on ACT_RU_EVENT_SUBSCR(EXECUTION_ID_);
  273. alter table ACT_RU_EVENT_SUBSCR
  274. add constraint ACT_FK_EVENT_EXEC
  275. foreign key (EXECUTION_ID_)
  276. references ACT_RU_EXECUTION(ID_);
  277. create index ACT_IDX_MODEL_SOURCE on ACT_RE_MODEL(EDITOR_SOURCE_VALUE_ID_);
  278. alter table ACT_RE_MODEL
  279. add constraint ACT_FK_MODEL_SOURCE
  280. foreign key (EDITOR_SOURCE_VALUE_ID_)
  281. references ACT_GE_BYTEARRAY (ID_);
  282. create index ACT_IDX_MODEL_SOURCE_EXTRA on ACT_RE_MODEL(EDITOR_SOURCE_EXTRA_VALUE_ID_);
  283. alter table ACT_RE_MODEL
  284. add constraint ACT_FK_MODEL_SOURCE_EXTRA
  285. foreign key (EDITOR_SOURCE_EXTRA_VALUE_ID_)
  286. references ACT_GE_BYTEARRAY (ID_);
  287. create index ACT_IDX_MODEL_DEPLOYMENT on ACT_RE_MODEL(DEPLOYMENT_ID_);
  288. alter table ACT_RE_MODEL
  289. add constraint ACT_FK_MODEL_DEPLOYMENT
  290. foreign key (DEPLOYMENT_ID_)
  291. references ACT_RE_DEPLOYMENT (ID_);
  292. create index ACT_IDX_PROCDEF_INFO_JSON on ACT_PROCDEF_INFO(INFO_JSON_ID_);
  293. alter table ACT_PROCDEF_INFO
  294. add constraint ACT_FK_INFO_JSON_BA
  295. foreign key (INFO_JSON_ID_)
  296. references ACT_GE_BYTEARRAY (ID_);
  297. create index ACT_IDX_PROCDEF_INFO_PROC on ACT_PROCDEF_INFO(PROC_DEF_ID_);
  298. alter table ACT_PROCDEF_INFO
  299. add constraint ACT_FK_INFO_PROCDEF
  300. foreign key (PROC_DEF_ID_)
  301. references ACT_RE_PROCDEF (ID_);
  302. alter table ACT_PROCDEF_INFO
  303. add constraint ACT_UNIQ_INFO_PROCDEF
  304. unique (PROC_DEF_ID_);
  305. create table ACT_HI_PROCINST (
  306. ID_ NVARCHAR2(64) not null,
  307. PROC_INST_ID_ NVARCHAR2(64) not null,
  308. BUSINESS_KEY_ NVARCHAR2(255),
  309. PROC_DEF_ID_ NVARCHAR2(64) not null,
  310. START_TIME_ TIMESTAMP(6) not null,
  311. END_TIME_ TIMESTAMP(6),
  312. DURATION_ NUMBER(19,0),
  313. START_USER_ID_ NVARCHAR2(255),
  314. START_ACT_ID_ NVARCHAR2(255),
  315. END_ACT_ID_ NVARCHAR2(255),
  316. SUPER_PROCESS_INSTANCE_ID_ NVARCHAR2(64),
  317. DELETE_REASON_ NVARCHAR2(2000),
  318. TENANT_ID_ NVARCHAR2(255) default '',
  319. NAME_ NVARCHAR2(255),
  320. primary key (ID_),
  321. unique (PROC_INST_ID_)
  322. );
  323. create table ACT_HI_ACTINST (
  324. ID_ NVARCHAR2(64) not null,
  325. PROC_DEF_ID_ NVARCHAR2(64) not null,
  326. PROC_INST_ID_ NVARCHAR2(64) not null,
  327. EXECUTION_ID_ NVARCHAR2(64) not null,
  328. ACT_ID_ NVARCHAR2(255) not null,
  329. TASK_ID_ NVARCHAR2(64),
  330. CALL_PROC_INST_ID_ NVARCHAR2(64),
  331. ACT_NAME_ NVARCHAR2(255),
  332. ACT_TYPE_ NVARCHAR2(255) not null,
  333. ASSIGNEE_ NVARCHAR2(255),
  334. START_TIME_ TIMESTAMP(6) not null,
  335. END_TIME_ TIMESTAMP(6),
  336. DURATION_ NUMBER(19,0),
  337. TENANT_ID_ NVARCHAR2(255) default '',
  338. primary key (ID_)
  339. );
  340. create table ACT_HI_TASKINST (
  341. ID_ NVARCHAR2(64) not null,
  342. PROC_DEF_ID_ NVARCHAR2(64),
  343. TASK_DEF_KEY_ NVARCHAR2(255),
  344. PROC_INST_ID_ NVARCHAR2(64),
  345. EXECUTION_ID_ NVARCHAR2(64),
  346. PARENT_TASK_ID_ NVARCHAR2(64),
  347. NAME_ NVARCHAR2(255),
  348. DESCRIPTION_ NVARCHAR2(2000),
  349. OWNER_ NVARCHAR2(255),
  350. ASSIGNEE_ NVARCHAR2(255),
  351. START_TIME_ TIMESTAMP(6) not null,
  352. CLAIM_TIME_ TIMESTAMP(6),
  353. END_TIME_ TIMESTAMP(6),
  354. DURATION_ NUMBER(19,0),
  355. DELETE_REASON_ NVARCHAR2(2000),
  356. PRIORITY_ INTEGER,
  357. DUE_DATE_ TIMESTAMP(6),
  358. FORM_KEY_ NVARCHAR2(255),
  359. CATEGORY_ NVARCHAR2(255),
  360. TENANT_ID_ NVARCHAR2(255) default '',
  361. primary key (ID_)
  362. );
  363. create table ACT_HI_VARINST (
  364. ID_ NVARCHAR2(64) not null,
  365. PROC_INST_ID_ NVARCHAR2(64),
  366. EXECUTION_ID_ NVARCHAR2(64),
  367. TASK_ID_ NVARCHAR2(64),
  368. NAME_ NVARCHAR2(255) not null,
  369. VAR_TYPE_ NVARCHAR2(100),
  370. REV_ INTEGER,
  371. BYTEARRAY_ID_ NVARCHAR2(64),
  372. DOUBLE_ NUMBER(*,10),
  373. LONG_ NUMBER(19,0),
  374. TEXT_ NVARCHAR2(2000),
  375. TEXT2_ NVARCHAR2(2000),
  376. CREATE_TIME_ TIMESTAMP(6),
  377. LAST_UPDATED_TIME_ TIMESTAMP(6),
  378. primary key (ID_)
  379. );
  380. create table ACT_HI_DETAIL (
  381. ID_ NVARCHAR2(64) not null,
  382. TYPE_ NVARCHAR2(255) not null,
  383. PROC_INST_ID_ NVARCHAR2(64),
  384. EXECUTION_ID_ NVARCHAR2(64),
  385. TASK_ID_ NVARCHAR2(64),
  386. ACT_INST_ID_ NVARCHAR2(64),
  387. NAME_ NVARCHAR2(255) not null,
  388. VAR_TYPE_ NVARCHAR2(64),
  389. REV_ INTEGER,
  390. TIME_ TIMESTAMP(6) not null,
  391. BYTEARRAY_ID_ NVARCHAR2(64),
  392. DOUBLE_ NUMBER(*,10),
  393. LONG_ NUMBER(19,0),
  394. TEXT_ NVARCHAR2(2000),
  395. TEXT2_ NVARCHAR2(2000),
  396. primary key (ID_)
  397. );
  398. create table ACT_HI_COMMENT (
  399. ID_ NVARCHAR2(64) not null,
  400. TYPE_ NVARCHAR2(255),
  401. TIME_ TIMESTAMP(6) not null,
  402. USER_ID_ NVARCHAR2(255),
  403. TASK_ID_ NVARCHAR2(64),
  404. PROC_INST_ID_ NVARCHAR2(64),
  405. ACTION_ NVARCHAR2(255),
  406. MESSAGE_ NVARCHAR2(2000),
  407. FULL_MSG_ BLOB,
  408. primary key (ID_)
  409. );
  410. create table ACT_HI_ATTACHMENT (
  411. ID_ NVARCHAR2(64) not null,
  412. REV_ INTEGER,
  413. USER_ID_ NVARCHAR2(255),
  414. NAME_ NVARCHAR2(255),
  415. DESCRIPTION_ NVARCHAR2(2000),
  416. TYPE_ NVARCHAR2(255),
  417. TASK_ID_ NVARCHAR2(64),
  418. PROC_INST_ID_ NVARCHAR2(64),
  419. URL_ NVARCHAR2(2000),
  420. CONTENT_ID_ NVARCHAR2(64),
  421. TIME_ TIMESTAMP(6),
  422. primary key (ID_)
  423. );
  424. create table ACT_HI_IDENTITYLINK (
  425. ID_ NVARCHAR2(64),
  426. GROUP_ID_ NVARCHAR2(255),
  427. TYPE_ NVARCHAR2(255),
  428. USER_ID_ NVARCHAR2(255),
  429. TASK_ID_ NVARCHAR2(64),
  430. PROC_INST_ID_ NVARCHAR2(64),
  431. primary key (ID_)
  432. );
  433. create index ACT_IDX_HI_PRO_INST_END on ACT_HI_PROCINST(END_TIME_);
  434. create index ACT_IDX_HI_PRO_I_BUSKEY on ACT_HI_PROCINST(BUSINESS_KEY_);
  435. create index ACT_IDX_HI_ACT_INST_START on ACT_HI_ACTINST(START_TIME_);
  436. create index ACT_IDX_HI_ACT_INST_END on ACT_HI_ACTINST(END_TIME_);
  437. create index ACT_IDX_HI_DETAIL_PROC_INST on ACT_HI_DETAIL(PROC_INST_ID_);
  438. create index ACT_IDX_HI_DETAIL_ACT_INST on ACT_HI_DETAIL(ACT_INST_ID_);
  439. create index ACT_IDX_HI_DETAIL_TIME on ACT_HI_DETAIL(TIME_);
  440. create index ACT_IDX_HI_DETAIL_NAME on ACT_HI_DETAIL(NAME_);
  441. create index ACT_IDX_HI_DETAIL_TASK_ID on ACT_HI_DETAIL(TASK_ID_);
  442. create index ACT_IDX_HI_PROCVAR_PROC_INST on ACT_HI_VARINST(PROC_INST_ID_);
  443. create index ACT_IDX_HI_PROCVAR_NAME_TYPE on ACT_HI_VARINST(NAME_, VAR_TYPE_);
  444. create index ACT_IDX_HI_PROCVAR_TASK_ID on ACT_HI_VARINST(TASK_ID_);
  445. create index ACT_IDX_HI_IDENT_LNK_USER on ACT_HI_IDENTITYLINK(USER_ID_);
  446. create index ACT_IDX_HI_IDENT_LNK_TASK on ACT_HI_IDENTITYLINK(TASK_ID_);
  447. create index ACT_IDX_HI_IDENT_LNK_PROCINST on ACT_HI_IDENTITYLINK(PROC_INST_ID_);
  448. create index ACT_IDX_HI_ACT_INST_PROCINST on ACT_HI_ACTINST(PROC_INST_ID_, ACT_ID_);
  449. create index ACT_IDX_HI_ACT_INST_EXEC on ACT_HI_ACTINST(EXECUTION_ID_, ACT_ID_);
  450. create index ACT_IDX_HI_TASK_INST_PROCINST on ACT_HI_TASKINST(PROC_INST_ID_);
  451. create table ACT_ID_GROUP (
  452. ID_ NVARCHAR2(64),
  453. REV_ INTEGER,
  454. NAME_ NVARCHAR2(255),
  455. TYPE_ NVARCHAR2(255),
  456. primary key (ID_)
  457. );
  458. create table ACT_ID_MEMBERSHIP (
  459. USER_ID_ NVARCHAR2(64),
  460. GROUP_ID_ NVARCHAR2(64),
  461. primary key (USER_ID_, GROUP_ID_)
  462. );
  463. create table ACT_ID_USER (
  464. ID_ NVARCHAR2(64),
  465. REV_ INTEGER,
  466. FIRST_ NVARCHAR2(255),
  467. LAST_ NVARCHAR2(255),
  468. EMAIL_ NVARCHAR2(255),
  469. PWD_ NVARCHAR2(255),
  470. PICTURE_ID_ NVARCHAR2(64),
  471. primary key (ID_)
  472. );
  473. create table ACT_ID_INFO (
  474. ID_ NVARCHAR2(64),
  475. REV_ INTEGER,
  476. USER_ID_ NVARCHAR2(64),
  477. TYPE_ NVARCHAR2(64),
  478. KEY_ NVARCHAR2(255),
  479. VALUE_ NVARCHAR2(255),
  480. PASSWORD_ BLOB,
  481. PARENT_ID_ NVARCHAR2(255),
  482. primary key (ID_)
  483. );
  484. create index ACT_IDX_MEMB_GROUP on ACT_ID_MEMBERSHIP(GROUP_ID_);
  485. alter table ACT_ID_MEMBERSHIP
  486. add constraint ACT_FK_MEMB_GROUP
  487. foreign key (GROUP_ID_)
  488. references ACT_ID_GROUP (ID_);
  489. create index ACT_IDX_MEMB_USER on ACT_ID_MEMBERSHIP(USER_ID_);
  490. alter table ACT_ID_MEMBERSHIP
  491. add constraint ACT_FK_MEMB_USER
  492. foreign key (USER_ID_)
  493. references ACT_ID_USER (ID_);