postgresql.sql 15 KB

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