blob: 3a143f2619298ef097ca14e495e393200937840e [file] [log] [blame]
Benjamin, Max (mb388a)5a6a6de2018-07-30 15:56:09 -04001
2USE `camundabpmn`;
3
4
5create table ACT_GE_PROPERTY (
6 NAME_ varchar(64),
7 VALUE_ varchar(300),
8 REV_ integer,
9 primary key (NAME_)
10) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE utf8_bin;
11
Benjamin, Max (mb388a)d5968f52021-02-05 20:34:11 -050012insert into ACT_GE_PROPERTY
13values ('schema.version', 'fox', 1);
14
15insert into ACT_GE_PROPERTY
16values ('schema.history', 'create(fox)', 1);
17
18insert into ACT_GE_PROPERTY
19values ('next.dbid', '1', 1);
20
21insert into ACT_GE_PROPERTY
22values ('deployment.lock', '0', 1);
23
24insert into ACT_GE_PROPERTY
25values ('history.cleanup.job.lock', '0', 1);
26
27insert into ACT_GE_PROPERTY
28values ('startup.lock', '0', 1);
29
30insert into ACT_GE_PROPERTY
31values ('telemetry.lock', '0', 1);
32
33insert into ACT_GE_PROPERTY
34values ('installationId.lock', '0', 1);
Benjamin, Max (mb388a)5a6a6de2018-07-30 15:56:09 -040035
36create table ACT_GE_BYTEARRAY (
37 ID_ varchar(64),
38 REV_ integer,
39 NAME_ varchar(255),
40 DEPLOYMENT_ID_ varchar(64),
41 BYTES_ LONGBLOB,
42 GENERATED_ TINYINT,
43 TENANT_ID_ varchar(64),
Benjamin, Max (mb388a)d5968f52021-02-05 20:34:11 -050044 TYPE_ integer,
45 CREATE_TIME_ datetime(3),
46 ROOT_PROC_INST_ID_ varchar(64),
47 REMOVAL_TIME_ datetime(3),
Benjamin, Max (mb388a)5a6a6de2018-07-30 15:56:09 -040048 primary key (ID_)
49) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE utf8_bin;
50
Benjamin, Max (mb388a)d5968f52021-02-05 20:34:11 -050051create table ACT_GE_SCHEMA_LOG (
52 ID_ varchar(64),
53 TIMESTAMP_ datetime(3),
54 VERSION_ varchar(255),
55 primary key (ID_)
56) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE utf8_bin;
57
58insert into ACT_GE_SCHEMA_LOG
59values ('0', CURRENT_TIMESTAMP, '7.14.0');
60
Benjamin, Max (mb388a)5a6a6de2018-07-30 15:56:09 -040061create table ACT_RE_DEPLOYMENT (
62 ID_ varchar(64),
63 NAME_ varchar(255),
Benjamin, Max (mb388a)d5968f52021-02-05 20:34:11 -050064 DEPLOY_TIME_ datetime(3),
Benjamin, Max (mb388a)5a6a6de2018-07-30 15:56:09 -040065 SOURCE_ varchar(255),
66 TENANT_ID_ varchar(64),
67 primary key (ID_)
68) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE utf8_bin;
69
70create table ACT_RU_EXECUTION (
71 ID_ varchar(64),
72 REV_ integer,
Benjamin, Max (mb388a)d5968f52021-02-05 20:34:11 -050073 ROOT_PROC_INST_ID_ varchar(64),
Benjamin, Max (mb388a)5a6a6de2018-07-30 15:56:09 -040074 PROC_INST_ID_ varchar(64),
75 BUSINESS_KEY_ varchar(255),
76 PARENT_ID_ varchar(64),
77 PROC_DEF_ID_ varchar(64),
78 SUPER_EXEC_ varchar(64),
79 SUPER_CASE_EXEC_ varchar(64),
80 CASE_INST_ID_ varchar(64),
81 ACT_ID_ varchar(255),
82 ACT_INST_ID_ varchar(64),
83 IS_ACTIVE_ TINYINT,
84 IS_CONCURRENT_ TINYINT,
85 IS_SCOPE_ TINYINT,
86 IS_EVENT_SCOPE_ TINYINT,
87 SUSPENSION_STATE_ integer,
88 CACHED_ENT_STATE_ integer,
89 SEQUENCE_COUNTER_ bigint,
90 TENANT_ID_ varchar(64),
91 primary key (ID_)
92) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE utf8_bin;
93
94create table ACT_RU_JOB (
95 ID_ varchar(64) NOT NULL,
96 REV_ integer,
97 TYPE_ varchar(255) NOT NULL,
Benjamin, Max (mb388a)d5968f52021-02-05 20:34:11 -050098 LOCK_EXP_TIME_ datetime(3) NULL,
Benjamin, Max (mb388a)5a6a6de2018-07-30 15:56:09 -040099 LOCK_OWNER_ varchar(255),
100 EXCLUSIVE_ boolean,
101 EXECUTION_ID_ varchar(64),
102 PROCESS_INSTANCE_ID_ varchar(64),
103 PROCESS_DEF_ID_ varchar(64),
104 PROCESS_DEF_KEY_ varchar(255),
105 RETRIES_ integer,
106 EXCEPTION_STACK_ID_ varchar(64),
107 EXCEPTION_MSG_ varchar(4000),
Benjamin, Max (mb388a)d5968f52021-02-05 20:34:11 -0500108 FAILED_ACT_ID_ varchar(255),
109 DUEDATE_ datetime(3) NULL,
Benjamin, Max (mb388a)5a6a6de2018-07-30 15:56:09 -0400110 REPEAT_ varchar(255),
Benjamin, Max (mb388a)d5968f52021-02-05 20:34:11 -0500111 REPEAT_OFFSET_ bigint DEFAULT 0,
Benjamin, Max (mb388a)5a6a6de2018-07-30 15:56:09 -0400112 HANDLER_TYPE_ varchar(255),
113 HANDLER_CFG_ varchar(4000),
114 DEPLOYMENT_ID_ varchar(64),
115 SUSPENSION_STATE_ integer NOT NULL DEFAULT 1,
116 JOB_DEF_ID_ varchar(64),
117 PRIORITY_ bigint NOT NULL DEFAULT 0,
118 SEQUENCE_COUNTER_ bigint,
119 TENANT_ID_ varchar(64),
Benjamin, Max (mb388a)d5968f52021-02-05 20:34:11 -0500120 CREATE_TIME_ datetime(3),
Benjamin, Max (mb388a)5a6a6de2018-07-30 15:56:09 -0400121 primary key (ID_)
122) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE utf8_bin;
123
124create table ACT_RU_JOBDEF (
125 ID_ varchar(64) NOT NULL,
126 REV_ integer,
127 PROC_DEF_ID_ varchar(64),
128 PROC_DEF_KEY_ varchar(255),
129 ACT_ID_ varchar(255),
130 JOB_TYPE_ varchar(255) NOT NULL,
131 JOB_CONFIGURATION_ varchar(255),
132 SUSPENSION_STATE_ integer,
133 JOB_PRIORITY_ bigint,
134 TENANT_ID_ varchar(64),
Benjamin, Max (mb388a)d5968f52021-02-05 20:34:11 -0500135 DEPLOYMENT_ID_ varchar(64),
Benjamin, Max (mb388a)5a6a6de2018-07-30 15:56:09 -0400136 primary key (ID_)
137) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE utf8_bin;
138
139create table ACT_RE_PROCDEF (
140 ID_ varchar(64) not null,
141 REV_ integer,
142 CATEGORY_ varchar(255),
143 NAME_ varchar(255),
144 KEY_ varchar(255) not null,
145 VERSION_ integer not null,
146 DEPLOYMENT_ID_ varchar(64),
147 RESOURCE_NAME_ varchar(4000),
148 DGRM_RESOURCE_NAME_ varchar(4000),
149 HAS_START_FORM_KEY_ TINYINT,
150 SUSPENSION_STATE_ integer,
151 TENANT_ID_ varchar(64),
152 VERSION_TAG_ varchar(64),
153 HISTORY_TTL_ integer,
Benjamin, Max (mb388a)d5968f52021-02-05 20:34:11 -0500154 STARTABLE_ boolean NOT NULL default TRUE,
Benjamin, Max (mb388a)5a6a6de2018-07-30 15:56:09 -0400155 primary key (ID_)
156) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE utf8_bin;
157
158create table ACT_RU_TASK (
159 ID_ varchar(64),
160 REV_ integer,
161 EXECUTION_ID_ varchar(64),
162 PROC_INST_ID_ varchar(64),
163 PROC_DEF_ID_ varchar(64),
164 CASE_EXECUTION_ID_ varchar(64),
165 CASE_INST_ID_ varchar(64),
166 CASE_DEF_ID_ varchar(64),
167 NAME_ varchar(255),
168 PARENT_TASK_ID_ varchar(64),
169 DESCRIPTION_ varchar(4000),
170 TASK_DEF_KEY_ varchar(255),
171 OWNER_ varchar(255),
172 ASSIGNEE_ varchar(255),
173 DELEGATION_ varchar(64),
174 PRIORITY_ integer,
Benjamin, Max (mb388a)d5968f52021-02-05 20:34:11 -0500175 CREATE_TIME_ datetime(3),
Benjamin, Max (mb388a)5a6a6de2018-07-30 15:56:09 -0400176 DUE_DATE_ datetime(3),
177 FOLLOW_UP_DATE_ datetime(3),
178 SUSPENSION_STATE_ integer,
179 TENANT_ID_ varchar(64),
180 primary key (ID_)
181) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE utf8_bin;
182
183create table ACT_RU_IDENTITYLINK (
184 ID_ varchar(64),
185 REV_ integer,
186 GROUP_ID_ varchar(255),
187 TYPE_ varchar(255),
188 USER_ID_ varchar(255),
189 TASK_ID_ varchar(64),
190 PROC_DEF_ID_ varchar(64),
191 TENANT_ID_ varchar(64),
192 primary key (ID_)
193) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE utf8_bin;
194
195create table ACT_RU_VARIABLE (
196 ID_ varchar(64) not null,
197 REV_ integer,
198 TYPE_ varchar(255) not null,
199 NAME_ varchar(255) not null,
200 EXECUTION_ID_ varchar(64),
201 PROC_INST_ID_ varchar(64),
Benjamin, Max (mb388a)d5968f52021-02-05 20:34:11 -0500202 PROC_DEF_ID_ varchar(64),
Benjamin, Max (mb388a)5a6a6de2018-07-30 15:56:09 -0400203 CASE_EXECUTION_ID_ varchar(64),
204 CASE_INST_ID_ varchar(64),
205 TASK_ID_ varchar(64),
Benjamin, Max (mb388a)d5968f52021-02-05 20:34:11 -0500206 BATCH_ID_ varchar(64),
Benjamin, Max (mb388a)5a6a6de2018-07-30 15:56:09 -0400207 BYTEARRAY_ID_ varchar(64),
208 DOUBLE_ double,
209 LONG_ bigint,
Benjamin, Max (mb388a)d5968f52021-02-05 20:34:11 -0500210 TEXT_ varchar(4000),
211 TEXT2_ varchar(4000),
Benjamin, Max (mb388a)5a6a6de2018-07-30 15:56:09 -0400212 VAR_SCOPE_ varchar(64) not null,
213 SEQUENCE_COUNTER_ bigint,
214 IS_CONCURRENT_LOCAL_ TINYINT,
215 TENANT_ID_ varchar(64),
216 primary key (ID_)
217) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE utf8_bin;
218
219create table ACT_RU_EVENT_SUBSCR (
220 ID_ varchar(64) not null,
221 REV_ integer,
222 EVENT_TYPE_ varchar(255) not null,
223 EVENT_NAME_ varchar(255),
224 EXECUTION_ID_ varchar(64),
225 PROC_INST_ID_ varchar(64),
226 ACTIVITY_ID_ varchar(255),
227 CONFIGURATION_ varchar(255),
Benjamin, Max (mb388a)d5968f52021-02-05 20:34:11 -0500228 CREATED_ datetime(3) not null,
Benjamin, Max (mb388a)5a6a6de2018-07-30 15:56:09 -0400229 TENANT_ID_ varchar(64),
230 primary key (ID_)
231) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE utf8_bin;
232
233create table ACT_RU_INCIDENT (
234 ID_ varchar(64) not null,
235 REV_ integer not null,
Benjamin, Max (mb388a)d5968f52021-02-05 20:34:11 -0500236 INCIDENT_TIMESTAMP_ datetime(3) not null,
Benjamin, Max (mb388a)5a6a6de2018-07-30 15:56:09 -0400237 INCIDENT_MSG_ varchar(4000),
238 INCIDENT_TYPE_ varchar(255) not null,
239 EXECUTION_ID_ varchar(64),
240 ACTIVITY_ID_ varchar(255),
Benjamin, Max (mb388a)d5968f52021-02-05 20:34:11 -0500241 FAILED_ACTIVITY_ID_ varchar(255),
Benjamin, Max (mb388a)5a6a6de2018-07-30 15:56:09 -0400242 PROC_INST_ID_ varchar(64),
243 PROC_DEF_ID_ varchar(64),
244 CAUSE_INCIDENT_ID_ varchar(64),
245 ROOT_CAUSE_INCIDENT_ID_ varchar(64),
246 CONFIGURATION_ varchar(255),
247 TENANT_ID_ varchar(64),
248 JOB_DEF_ID_ varchar(64),
249 primary key (ID_)
250) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE utf8_bin;
251
252create table ACT_RU_AUTHORIZATION (
253 ID_ varchar(64) not null,
254 REV_ integer not null,
255 TYPE_ integer not null,
256 GROUP_ID_ varchar(255),
257 USER_ID_ varchar(255),
258 RESOURCE_TYPE_ integer not null,
259 RESOURCE_ID_ varchar(255),
260 PERMS_ integer,
Benjamin, Max (mb388a)d5968f52021-02-05 20:34:11 -0500261 REMOVAL_TIME_ datetime(3),
262 ROOT_PROC_INST_ID_ varchar(64),
Benjamin, Max (mb388a)5a6a6de2018-07-30 15:56:09 -0400263 primary key (ID_)
264) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE utf8_bin;
265
266create table ACT_RU_FILTER (
267 ID_ varchar(64) not null,
268 REV_ integer not null,
269 RESOURCE_TYPE_ varchar(255) not null,
270 NAME_ varchar(255) not null,
271 OWNER_ varchar(255),
272 QUERY_ LONGTEXT not null,
273 PROPERTIES_ LONGTEXT,
274 primary key (ID_)
275) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE utf8_bin;
276
277create table ACT_RU_METER_LOG (
278 ID_ varchar(64) not null,
279 NAME_ varchar(64) not null,
280 REPORTER_ varchar(255),
281 VALUE_ bigint,
Benjamin, Max (mb388a)d5968f52021-02-05 20:34:11 -0500282 TIMESTAMP_ datetime(3),
Benjamin, Max (mb388a)5a6a6de2018-07-30 15:56:09 -0400283 MILLISECONDS_ bigint DEFAULT 0,
284 primary key (ID_)
285) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE utf8_bin;
286
287create table ACT_RU_EXT_TASK (
288 ID_ varchar(64) not null,
289 REV_ integer not null,
290 WORKER_ID_ varchar(255),
291 TOPIC_NAME_ varchar(255),
292 RETRIES_ integer,
293 ERROR_MSG_ varchar(4000),
294 ERROR_DETAILS_ID_ varchar(64),
Benjamin, Max (mb388a)d5968f52021-02-05 20:34:11 -0500295 LOCK_EXP_TIME_ datetime(3) NULL,
Benjamin, Max (mb388a)5a6a6de2018-07-30 15:56:09 -0400296 SUSPENSION_STATE_ integer,
297 EXECUTION_ID_ varchar(64),
298 PROC_INST_ID_ varchar(64),
299 PROC_DEF_ID_ varchar(64),
300 PROC_DEF_KEY_ varchar(255),
301 ACT_ID_ varchar(255),
302 ACT_INST_ID_ varchar(64),
303 TENANT_ID_ varchar(64),
304 PRIORITY_ bigint NOT NULL DEFAULT 0,
305 primary key (ID_)
306) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE utf8_bin;
307
308create table ACT_RU_BATCH (
309 ID_ varchar(64) not null,
310 REV_ integer not null,
311 TYPE_ varchar(255),
312 TOTAL_JOBS_ integer,
313 JOBS_CREATED_ integer,
314 JOBS_PER_SEED_ integer,
315 INVOCATIONS_PER_JOB_ integer,
316 SEED_JOB_DEF_ID_ varchar(64),
317 BATCH_JOB_DEF_ID_ varchar(64),
318 MONITOR_JOB_DEF_ID_ varchar(64),
319 SUSPENSION_STATE_ integer,
320 CONFIGURATION_ varchar(255),
321 TENANT_ID_ varchar(64),
Benjamin, Max (mb388a)d5968f52021-02-05 20:34:11 -0500322 CREATE_USER_ID_ varchar(255),
Benjamin, Max (mb388a)5a6a6de2018-07-30 15:56:09 -0400323 primary key (ID_)
324) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE utf8_bin;
325
Benjamin, Max (mb388a)d5968f52021-02-05 20:34:11 -0500326create index ACT_IDX_EXEC_ROOT_PI on ACT_RU_EXECUTION(ROOT_PROC_INST_ID_);
Benjamin, Max (mb388a)5a6a6de2018-07-30 15:56:09 -0400327create index ACT_IDX_EXEC_BUSKEY on ACT_RU_EXECUTION(BUSINESS_KEY_);
328create index ACT_IDX_EXEC_TENANT_ID on ACT_RU_EXECUTION(TENANT_ID_);
329create index ACT_IDX_TASK_CREATE on ACT_RU_TASK(CREATE_TIME_);
330create index ACT_IDX_TASK_ASSIGNEE on ACT_RU_TASK(ASSIGNEE_);
Benjamin, Max (mb388a)d5968f52021-02-05 20:34:11 -0500331create index ACT_IDX_TASK_OWNER on ACT_RU_TASK(OWNER_);
Benjamin, Max (mb388a)5a6a6de2018-07-30 15:56:09 -0400332create index ACT_IDX_TASK_TENANT_ID on ACT_RU_TASK(TENANT_ID_);
333create index ACT_IDX_IDENT_LNK_USER on ACT_RU_IDENTITYLINK(USER_ID_);
334create index ACT_IDX_IDENT_LNK_GROUP on ACT_RU_IDENTITYLINK(GROUP_ID_);
335create index ACT_IDX_EVENT_SUBSCR_CONFIG_ on ACT_RU_EVENT_SUBSCR(CONFIGURATION_);
336create index ACT_IDX_EVENT_SUBSCR_TENANT_ID on ACT_RU_EVENT_SUBSCR(TENANT_ID_);
Benjamin, Max (mb388a)d5968f52021-02-05 20:34:11 -0500337
Benjamin, Max (mb388a)5a6a6de2018-07-30 15:56:09 -0400338create index ACT_IDX_VARIABLE_TASK_ID on ACT_RU_VARIABLE(TASK_ID_);
339create index ACT_IDX_VARIABLE_TENANT_ID on ACT_RU_VARIABLE(TENANT_ID_);
Benjamin, Max (mb388a)d5968f52021-02-05 20:34:11 -0500340create index ACT_IDX_VARIABLE_TASK_NAME_TYPE on ACT_RU_VARIABLE(TASK_ID_, NAME_, TYPE_);
341
Benjamin, Max (mb388a)5a6a6de2018-07-30 15:56:09 -0400342create index ACT_IDX_ATHRZ_PROCEDEF on ACT_RU_IDENTITYLINK(PROC_DEF_ID_);
343create index ACT_IDX_INC_CONFIGURATION on ACT_RU_INCIDENT(CONFIGURATION_);
344create index ACT_IDX_INC_TENANT_ID on ACT_RU_INCIDENT(TENANT_ID_);
345-- CAM-5914
346create index ACT_IDX_JOB_EXECUTION_ID on ACT_RU_JOB(EXECUTION_ID_);
347-- this index needs to be limited in mariadb see CAM-6938
348create index ACT_IDX_JOB_HANDLER on ACT_RU_JOB(HANDLER_TYPE_(100),HANDLER_CFG_(155));
349create index ACT_IDX_JOB_PROCINST on ACT_RU_JOB(PROCESS_INSTANCE_ID_);
350create index ACT_IDX_JOB_TENANT_ID on ACT_RU_JOB(TENANT_ID_);
351create index ACT_IDX_JOBDEF_TENANT_ID on ACT_RU_JOBDEF(TENANT_ID_);
352
353-- new metric milliseconds column
354CREATE INDEX ACT_IDX_METER_LOG_MS ON ACT_RU_METER_LOG(MILLISECONDS_);
355CREATE INDEX ACT_IDX_METER_LOG_NAME_MS ON ACT_RU_METER_LOG(NAME_, MILLISECONDS_);
356CREATE INDEX ACT_IDX_METER_LOG_REPORT ON ACT_RU_METER_LOG(NAME_, REPORTER_, MILLISECONDS_);
357
358-- old metric timestamp column
359CREATE INDEX ACT_IDX_METER_LOG_TIME ON ACT_RU_METER_LOG(TIMESTAMP_);
360CREATE INDEX ACT_IDX_METER_LOG ON ACT_RU_METER_LOG(NAME_, TIMESTAMP_);
361
362create index ACT_IDX_EXT_TASK_TOPIC on ACT_RU_EXT_TASK(TOPIC_NAME_);
363create index ACT_IDX_EXT_TASK_TENANT_ID on ACT_RU_EXT_TASK(TENANT_ID_);
364create index ACT_IDX_EXT_TASK_PRIORITY ON ACT_RU_EXT_TASK(PRIORITY_);
365create index ACT_IDX_EXT_TASK_ERR_DETAILS ON ACT_RU_EXT_TASK(ERROR_DETAILS_ID_);
366create index ACT_IDX_AUTH_GROUP_ID ON ACT_RU_AUTHORIZATION(GROUP_ID_);
367create index ACT_IDX_JOB_JOB_DEF_ID on ACT_RU_JOB(JOB_DEF_ID_);
368
369alter table ACT_GE_BYTEARRAY
370 add constraint ACT_FK_BYTEARR_DEPL
371 foreign key (DEPLOYMENT_ID_)
372 references ACT_RE_DEPLOYMENT (ID_);
373
374alter table ACT_RU_EXECUTION
375 add constraint ACT_FK_EXE_PROCINST
376 foreign key (PROC_INST_ID_)
377 references ACT_RU_EXECUTION (ID_) on delete cascade on update cascade;
378
379alter table ACT_RU_EXECUTION
380 add constraint ACT_FK_EXE_PARENT
381 foreign key (PARENT_ID_)
382 references ACT_RU_EXECUTION (ID_);
383
384alter table ACT_RU_EXECUTION
385 add constraint ACT_FK_EXE_SUPER
386 foreign key (SUPER_EXEC_)
387 references ACT_RU_EXECUTION (ID_);
388
389alter table ACT_RU_EXECUTION
390 add constraint ACT_FK_EXE_PROCDEF
391 foreign key (PROC_DEF_ID_)
392 references ACT_RE_PROCDEF (ID_);
393
394alter table ACT_RU_IDENTITYLINK
395 add constraint ACT_FK_TSKASS_TASK
396 foreign key (TASK_ID_)
397 references ACT_RU_TASK (ID_);
398
399alter table ACT_RU_IDENTITYLINK
400 add constraint ACT_FK_ATHRZ_PROCEDEF
401 foreign key (PROC_DEF_ID_)
402 references ACT_RE_PROCDEF(ID_);
403
404alter table ACT_RU_TASK
405 add constraint ACT_FK_TASK_EXE
406 foreign key (EXECUTION_ID_)
407 references ACT_RU_EXECUTION (ID_);
408
409alter table ACT_RU_TASK
410 add constraint ACT_FK_TASK_PROCINST
411 foreign key (PROC_INST_ID_)
412 references ACT_RU_EXECUTION (ID_);
413
414alter table ACT_RU_TASK
415 add constraint ACT_FK_TASK_PROCDEF
416 foreign key (PROC_DEF_ID_)
417 references ACT_RE_PROCDEF (ID_);
418
419alter table ACT_RU_VARIABLE
420 add constraint ACT_FK_VAR_EXE
421 foreign key (EXECUTION_ID_)
422 references ACT_RU_EXECUTION (ID_);
423
424alter table ACT_RU_VARIABLE
425 add constraint ACT_FK_VAR_PROCINST
426 foreign key (PROC_INST_ID_)
427 references ACT_RU_EXECUTION(ID_);
428
429alter table ACT_RU_VARIABLE
430 add constraint ACT_FK_VAR_BYTEARRAY
431 foreign key (BYTEARRAY_ID_)
432 references ACT_GE_BYTEARRAY (ID_);
433
434alter table ACT_RU_JOB
435 add constraint ACT_FK_JOB_EXCEPTION
436 foreign key (EXCEPTION_STACK_ID_)
437 references ACT_GE_BYTEARRAY (ID_);
438
439alter table ACT_RU_EVENT_SUBSCR
440 add constraint ACT_FK_EVENT_EXEC
441 foreign key (EXECUTION_ID_)
442 references ACT_RU_EXECUTION(ID_);
443
444alter table ACT_RU_INCIDENT
445 add constraint ACT_FK_INC_EXE
446 foreign key (EXECUTION_ID_)
447 references ACT_RU_EXECUTION (ID_);
448
449alter table ACT_RU_INCIDENT
450 add constraint ACT_FK_INC_PROCINST
451 foreign key (PROC_INST_ID_)
452 references ACT_RU_EXECUTION (ID_);
453
454alter table ACT_RU_INCIDENT
455 add constraint ACT_FK_INC_PROCDEF
456 foreign key (PROC_DEF_ID_)
457 references ACT_RE_PROCDEF (ID_);
458
459alter table ACT_RU_INCIDENT
460 add constraint ACT_FK_INC_CAUSE
461 foreign key (CAUSE_INCIDENT_ID_)
462 references ACT_RU_INCIDENT (ID_) on delete cascade on update cascade;
463
464alter table ACT_RU_INCIDENT
465 add constraint ACT_FK_INC_RCAUSE
466 foreign key (ROOT_CAUSE_INCIDENT_ID_)
467 references ACT_RU_INCIDENT (ID_) on delete cascade on update cascade;
468
469alter table ACT_RU_EXT_TASK
470 add constraint ACT_FK_EXT_TASK_ERROR_DETAILS
471 foreign key (ERROR_DETAILS_ID_)
472 references ACT_GE_BYTEARRAY (ID_);
473
474create index ACT_IDX_INC_JOB_DEF on ACT_RU_INCIDENT(JOB_DEF_ID_);
475alter table ACT_RU_INCIDENT
476 add constraint ACT_FK_INC_JOB_DEF
477 foreign key (JOB_DEF_ID_)
478 references ACT_RU_JOBDEF (ID_);
479
480alter table ACT_RU_AUTHORIZATION
481 add constraint ACT_UNIQ_AUTH_USER
482 unique (USER_ID_,TYPE_,RESOURCE_TYPE_,RESOURCE_ID_);
483
484alter table ACT_RU_AUTHORIZATION
485 add constraint ACT_UNIQ_AUTH_GROUP
486 unique (GROUP_ID_,TYPE_,RESOURCE_TYPE_,RESOURCE_ID_);
487
488alter table ACT_RU_VARIABLE
489 add constraint ACT_UNIQ_VARIABLE
490 unique (VAR_SCOPE_, NAME_);
491
492alter table ACT_RU_EXT_TASK
493 add constraint ACT_FK_EXT_TASK_EXE
494 foreign key (EXECUTION_ID_)
495 references ACT_RU_EXECUTION (ID_);
496
497create index ACT_IDX_BATCH_SEED_JOB_DEF ON ACT_RU_BATCH(SEED_JOB_DEF_ID_);
498alter table ACT_RU_BATCH
499 add constraint ACT_FK_BATCH_SEED_JOB_DEF
500 foreign key (SEED_JOB_DEF_ID_)
501 references ACT_RU_JOBDEF (ID_);
502
503create index ACT_IDX_BATCH_MONITOR_JOB_DEF ON ACT_RU_BATCH(MONITOR_JOB_DEF_ID_);
504alter table ACT_RU_BATCH
505 add constraint ACT_FK_BATCH_MONITOR_JOB_DEF
506 foreign key (MONITOR_JOB_DEF_ID_)
507 references ACT_RU_JOBDEF (ID_);
508
509create index ACT_IDX_BATCH_JOB_DEF ON ACT_RU_BATCH(BATCH_JOB_DEF_ID_);
510alter table ACT_RU_BATCH
511 add constraint ACT_FK_BATCH_JOB_DEF
512 foreign key (BATCH_JOB_DEF_ID_)
513 references ACT_RU_JOBDEF (ID_);
514
Benjamin, Max (mb388a)d5968f52021-02-05 20:34:11 -0500515create index ACT_IDX_BATCH_ID ON ACT_RU_VARIABLE(BATCH_ID_);
516alter table ACT_RU_VARIABLE
517 add constraint ACT_FK_VAR_BATCH
518 foreign key (BATCH_ID_)
519 references ACT_RU_BATCH (ID_);
520
Benjamin, Max (mb388a)5a6a6de2018-07-30 15:56:09 -0400521-- indexes for deadlock problems - https://app.camunda.com/jira/browse/CAM-2567 --
522create index ACT_IDX_INC_CAUSEINCID on ACT_RU_INCIDENT(CAUSE_INCIDENT_ID_);
523create index ACT_IDX_INC_EXID on ACT_RU_INCIDENT(EXECUTION_ID_);
524create index ACT_IDX_INC_PROCDEFID on ACT_RU_INCIDENT(PROC_DEF_ID_);
525create index ACT_IDX_INC_PROCINSTID on ACT_RU_INCIDENT(PROC_INST_ID_);
526create index ACT_IDX_INC_ROOTCAUSEINCID on ACT_RU_INCIDENT(ROOT_CAUSE_INCIDENT_ID_);
527-- index for deadlock problem - https://app.camunda.com/jira/browse/CAM-4440 --
528create index ACT_IDX_AUTH_RESOURCE_ID on ACT_RU_AUTHORIZATION(RESOURCE_ID_);
529-- index to prevent deadlock on fk constraint - https://app.camunda.com/jira/browse/CAM-5440 --
530create index ACT_IDX_EXT_TASK_EXEC on ACT_RU_EXT_TASK(EXECUTION_ID_);
531
532-- indexes to improve deployment
Benjamin, Max (mb388a)d5968f52021-02-05 20:34:11 -0500533create index ACT_IDX_BYTEARRAY_ROOT_PI on ACT_GE_BYTEARRAY(ROOT_PROC_INST_ID_);
534create index ACT_IDX_BYTEARRAY_RM_TIME on ACT_GE_BYTEARRAY(REMOVAL_TIME_);
Benjamin, Max (mb388a)5a6a6de2018-07-30 15:56:09 -0400535create index ACT_IDX_BYTEARRAY_NAME on ACT_GE_BYTEARRAY(NAME_);
536create index ACT_IDX_DEPLOYMENT_NAME on ACT_RE_DEPLOYMENT(NAME_);
537create index ACT_IDX_DEPLOYMENT_TENANT_ID on ACT_RE_DEPLOYMENT(TENANT_ID_);
538create index ACT_IDX_JOBDEF_PROC_DEF_ID ON ACT_RU_JOBDEF(PROC_DEF_ID_);
539create index ACT_IDX_JOB_HANDLER_TYPE ON ACT_RU_JOB(HANDLER_TYPE_);
540create index ACT_IDX_EVENT_SUBSCR_EVT_NAME ON ACT_RU_EVENT_SUBSCR(EVENT_NAME_);
541create index ACT_IDX_PROCDEF_DEPLOYMENT_ID ON ACT_RE_PROCDEF(DEPLOYMENT_ID_);
542create index ACT_IDX_PROCDEF_TENANT_ID ON ACT_RE_PROCDEF(TENANT_ID_);
543create index ACT_IDX_PROCDEF_VER_TAG ON ACT_RE_PROCDEF(VERSION_TAG_);
Benjamin, Max (mb388a)d5968f52021-02-05 20:34:11 -0500544
545-- indices for history cleanup: https://jira.camunda.com/browse/CAM-11616
546create index ACT_IDX_AUTH_ROOT_PI on ACT_RU_AUTHORIZATION(ROOT_PROC_INST_ID_);
547create index ACT_IDX_AUTH_RM_TIME on ACT_RU_AUTHORIZATION(REMOVAL_TIME_);
548--
549-- Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH
550-- under one or more contributor license agreements. See the NOTICE file
551-- distributed with this work for additional information regarding copyright
552-- ownership. Camunda licenses this file to you under the Apache License,
553-- Version 2.0; you may not use this file except in compliance with the License.
554-- You may obtain a copy of the License at
555--
556-- http://www.apache.org/licenses/LICENSE-2.0
557--
558-- Unless required by applicable law or agreed to in writing, software
559-- distributed under the License is distributed on an "AS IS" BASIS,
560-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
561-- See the License for the specific language governing permissions and
562-- limitations under the License.
563--
564
Benjamin, Max (mb388a)5a6a6de2018-07-30 15:56:09 -0400565-- create case definition table --
566create table ACT_RE_CASE_DEF (
567 ID_ varchar(64) not null,
568 REV_ integer,
569 CATEGORY_ varchar(255),
570 NAME_ varchar(255),
571 KEY_ varchar(255) not null,
572 VERSION_ integer not null,
573 DEPLOYMENT_ID_ varchar(64),
574 RESOURCE_NAME_ varchar(4000),
575 DGRM_RESOURCE_NAME_ varchar(4000),
576 TENANT_ID_ varchar(64),
577 HISTORY_TTL_ integer,
578 primary key (ID_)
579) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE utf8_bin;
580
581-- create case execution table --
582create table ACT_RU_CASE_EXECUTION (
583 ID_ varchar(64) NOT NULL,
584 REV_ integer,
585 CASE_INST_ID_ varchar(64),
586 SUPER_CASE_EXEC_ varchar(64),
587 SUPER_EXEC_ varchar(64),
588 BUSINESS_KEY_ varchar(255),
589 PARENT_ID_ varchar(64),
590 CASE_DEF_ID_ varchar(64),
591 ACT_ID_ varchar(255),
592 PREV_STATE_ integer,
593 CURRENT_STATE_ integer,
594 REQUIRED_ boolean,
595 TENANT_ID_ varchar(64),
596 primary key (ID_)
597) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE utf8_bin;
598
599-- create case sentry part table --
600
601create table ACT_RU_CASE_SENTRY_PART (
602 ID_ varchar(64) NOT NULL,
603 REV_ integer,
604 CASE_INST_ID_ varchar(64),
605 CASE_EXEC_ID_ varchar(64),
606 SENTRY_ID_ varchar(255),
607 TYPE_ varchar(255),
608 SOURCE_CASE_EXEC_ID_ varchar(64),
609 STANDARD_EVENT_ varchar(255),
610 SOURCE_ varchar(255),
611 VARIABLE_EVENT_ varchar(255),
612 VARIABLE_NAME_ varchar(255),
613 SATISFIED_ boolean,
614 TENANT_ID_ varchar(64),
615 primary key (ID_)
616) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE utf8_bin;
617
618-- create index on business key --
619create index ACT_IDX_CASE_EXEC_BUSKEY on ACT_RU_CASE_EXECUTION(BUSINESS_KEY_);
620
Benjamin, Max (mb388a)d5968f52021-02-05 20:34:11 -0500621-- https://app.camunda.com/jira/browse/CAM-9165
622create index ACT_IDX_CASE_EXE_CASE_INST on ACT_RU_CASE_EXECUTION(CASE_INST_ID_);
623
Benjamin, Max (mb388a)5a6a6de2018-07-30 15:56:09 -0400624-- create foreign key constraints on ACT_RU_CASE_EXECUTION --
625alter table ACT_RU_CASE_EXECUTION
626 add constraint ACT_FK_CASE_EXE_CASE_INST
627 foreign key (CASE_INST_ID_)
628 references ACT_RU_CASE_EXECUTION(ID_) on delete cascade on update cascade;
629
630alter table ACT_RU_CASE_EXECUTION
631 add constraint ACT_FK_CASE_EXE_PARENT
632 foreign key (PARENT_ID_)
633 references ACT_RU_CASE_EXECUTION(ID_);
634
635alter table ACT_RU_CASE_EXECUTION
636 add constraint ACT_FK_CASE_EXE_CASE_DEF
637 foreign key (CASE_DEF_ID_)
638 references ACT_RE_CASE_DEF(ID_);
639
640-- create foreign key constraints on ACT_RU_VARIABLE --
641alter table ACT_RU_VARIABLE
642 add constraint ACT_FK_VAR_CASE_EXE
643 foreign key (CASE_EXECUTION_ID_)
644 references ACT_RU_CASE_EXECUTION(ID_);
645
646alter table ACT_RU_VARIABLE
647 add constraint ACT_FK_VAR_CASE_INST
648 foreign key (CASE_INST_ID_)
649 references ACT_RU_CASE_EXECUTION(ID_);
650
651-- create foreign key constraints on ACT_RU_TASK --
652alter table ACT_RU_TASK
653 add constraint ACT_FK_TASK_CASE_EXE
654 foreign key (CASE_EXECUTION_ID_)
655 references ACT_RU_CASE_EXECUTION(ID_);
656
657alter table ACT_RU_TASK
658 add constraint ACT_FK_TASK_CASE_DEF
659 foreign key (CASE_DEF_ID_)
660 references ACT_RE_CASE_DEF(ID_);
661
662-- create foreign key constraints on ACT_RU_CASE_SENTRY_PART --
663alter table ACT_RU_CASE_SENTRY_PART
664 add constraint ACT_FK_CASE_SENTRY_CASE_INST
665 foreign key (CASE_INST_ID_)
666 references ACT_RU_CASE_EXECUTION(ID_);
667
668alter table ACT_RU_CASE_SENTRY_PART
669 add constraint ACT_FK_CASE_SENTRY_CASE_EXEC
670 foreign key (CASE_EXEC_ID_)
671 references ACT_RU_CASE_EXECUTION(ID_);
672
673create index ACT_IDX_CASE_DEF_TENANT_ID on ACT_RE_CASE_DEF(TENANT_ID_);
674create index ACT_IDX_CASE_EXEC_TENANT_ID on ACT_RU_CASE_EXECUTION(TENANT_ID_);
Benjamin, Max (mb388a)d5968f52021-02-05 20:34:11 -0500675--
676-- Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH
677-- under one or more contributor license agreements. See the NOTICE file
678-- distributed with this work for additional information regarding copyright
679-- ownership. Camunda licenses this file to you under the Apache License,
680-- Version 2.0; you may not use this file except in compliance with the License.
681-- You may obtain a copy of the License at
682--
683-- http://www.apache.org/licenses/LICENSE-2.0
684--
685-- Unless required by applicable law or agreed to in writing, software
686-- distributed under the License is distributed on an "AS IS" BASIS,
687-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
688-- See the License for the specific language governing permissions and
689-- limitations under the License.
690--
691
Benjamin, Max (mb388a)5a6a6de2018-07-30 15:56:09 -0400692-- create decision definition table --
693create table ACT_RE_DECISION_DEF (
694 ID_ varchar(64) not null,
695 REV_ integer,
696 CATEGORY_ varchar(255),
697 NAME_ varchar(255),
698 KEY_ varchar(255) not null,
699 VERSION_ integer not null,
700 DEPLOYMENT_ID_ varchar(64),
701 RESOURCE_NAME_ varchar(4000),
702 DGRM_RESOURCE_NAME_ varchar(4000),
703 DEC_REQ_ID_ varchar(64),
704 DEC_REQ_KEY_ varchar(255),
705 TENANT_ID_ varchar(64),
706 HISTORY_TTL_ integer,
707 VERSION_TAG_ varchar(64),
708 primary key (ID_)
709) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE utf8_bin;
710
711-- create decision requirements definition table --
712create table ACT_RE_DECISION_REQ_DEF (
713 ID_ varchar(64) NOT NULL,
714 REV_ integer,
715 CATEGORY_ varchar(255),
716 NAME_ varchar(255),
717 KEY_ varchar(255) NOT NULL,
718 VERSION_ integer NOT NULL,
719 DEPLOYMENT_ID_ varchar(64),
720 RESOURCE_NAME_ varchar(4000),
721 DGRM_RESOURCE_NAME_ varchar(4000),
722 TENANT_ID_ varchar(64),
723 primary key (ID_)
724) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE utf8_bin;
725
726alter table ACT_RE_DECISION_DEF
727 add constraint ACT_FK_DEC_REQ
728 foreign key (DEC_REQ_ID_)
729 references ACT_RE_DECISION_REQ_DEF(ID_);
730
731create index ACT_IDX_DEC_DEF_TENANT_ID on ACT_RE_DECISION_DEF(TENANT_ID_);
732create index ACT_IDX_DEC_DEF_REQ_ID on ACT_RE_DECISION_DEF(DEC_REQ_ID_);
733create index ACT_IDX_DEC_REQ_DEF_TENANT_ID on ACT_RE_DECISION_REQ_DEF(TENANT_ID_);
Benjamin, Max (mb388a)d5968f52021-02-05 20:34:11 -0500734--
735-- Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH
736-- under one or more contributor license agreements. See the NOTICE file
737-- distributed with this work for additional information regarding copyright
738-- ownership. Camunda licenses this file to you under the Apache License,
739-- Version 2.0; you may not use this file except in compliance with the License.
740-- You may obtain a copy of the License at
741--
742-- http://www.apache.org/licenses/LICENSE-2.0
743--
744-- Unless required by applicable law or agreed to in writing, software
745-- distributed under the License is distributed on an "AS IS" BASIS,
746-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
747-- See the License for the specific language governing permissions and
748-- limitations under the License.
749--
750
Benjamin, Max (mb388a)5a6a6de2018-07-30 15:56:09 -0400751create table ACT_HI_PROCINST (
752 ID_ varchar(64) not null,
753 PROC_INST_ID_ varchar(64) not null,
754 BUSINESS_KEY_ varchar(255),
755 PROC_DEF_KEY_ varchar(255),
756 PROC_DEF_ID_ varchar(64) not null,
757 START_TIME_ datetime(3) not null,
758 END_TIME_ datetime(3),
Benjamin, Max (mb388a)d5968f52021-02-05 20:34:11 -0500759 REMOVAL_TIME_ datetime(3),
Benjamin, Max (mb388a)5a6a6de2018-07-30 15:56:09 -0400760 DURATION_ bigint,
761 START_USER_ID_ varchar(255),
762 START_ACT_ID_ varchar(255),
763 END_ACT_ID_ varchar(255),
764 SUPER_PROCESS_INSTANCE_ID_ varchar(64),
Benjamin, Max (mb388a)d5968f52021-02-05 20:34:11 -0500765 ROOT_PROC_INST_ID_ varchar(64),
Benjamin, Max (mb388a)5a6a6de2018-07-30 15:56:09 -0400766 SUPER_CASE_INSTANCE_ID_ varchar(64),
767 CASE_INST_ID_ varchar(64),
768 DELETE_REASON_ varchar(4000),
769 TENANT_ID_ varchar(64),
770 STATE_ varchar(255),
771 primary key (ID_),
772 unique (PROC_INST_ID_)
773) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE utf8_bin;
774
775create table ACT_HI_ACTINST (
776 ID_ varchar(64) not null,
777 PARENT_ACT_INST_ID_ varchar(64),
778 PROC_DEF_KEY_ varchar(255),
779 PROC_DEF_ID_ varchar(64) not null,
Benjamin, Max (mb388a)d5968f52021-02-05 20:34:11 -0500780 ROOT_PROC_INST_ID_ varchar(64),
Benjamin, Max (mb388a)5a6a6de2018-07-30 15:56:09 -0400781 PROC_INST_ID_ varchar(64) not null,
782 EXECUTION_ID_ varchar(64) not null,
783 ACT_ID_ varchar(255) not null,
784 TASK_ID_ varchar(64),
785 CALL_PROC_INST_ID_ varchar(64),
786 CALL_CASE_INST_ID_ varchar(64),
787 ACT_NAME_ varchar(255),
788 ACT_TYPE_ varchar(255) not null,
Benjamin, Max (mb388a)d5968f52021-02-05 20:34:11 -0500789 ASSIGNEE_ varchar(255),
Benjamin, Max (mb388a)5a6a6de2018-07-30 15:56:09 -0400790 START_TIME_ datetime(3) not null,
791 END_TIME_ datetime(3),
792 DURATION_ bigint,
793 ACT_INST_STATE_ integer,
794 SEQUENCE_COUNTER_ bigint,
795 TENANT_ID_ varchar(64),
Benjamin, Max (mb388a)d5968f52021-02-05 20:34:11 -0500796 REMOVAL_TIME_ datetime(3),
Benjamin, Max (mb388a)5a6a6de2018-07-30 15:56:09 -0400797 primary key (ID_)
798) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE utf8_bin;
799
800create table ACT_HI_TASKINST (
801 ID_ varchar(64) not null,
802 TASK_DEF_KEY_ varchar(255),
803 PROC_DEF_KEY_ varchar(255),
804 PROC_DEF_ID_ varchar(64),
Benjamin, Max (mb388a)d5968f52021-02-05 20:34:11 -0500805 ROOT_PROC_INST_ID_ varchar(64),
Benjamin, Max (mb388a)5a6a6de2018-07-30 15:56:09 -0400806 PROC_INST_ID_ varchar(64),
807 EXECUTION_ID_ varchar(64),
808 CASE_DEF_KEY_ varchar(255),
809 CASE_DEF_ID_ varchar(64),
810 CASE_INST_ID_ varchar(64),
811 CASE_EXECUTION_ID_ varchar(64),
812 ACT_INST_ID_ varchar(64),
813 NAME_ varchar(255),
814 PARENT_TASK_ID_ varchar(64),
815 DESCRIPTION_ varchar(4000),
816 OWNER_ varchar(255),
817 ASSIGNEE_ varchar(255),
818 START_TIME_ datetime(3) not null,
819 END_TIME_ datetime(3),
820 DURATION_ bigint,
821 DELETE_REASON_ varchar(4000),
822 PRIORITY_ integer,
823 DUE_DATE_ datetime(3),
824 FOLLOW_UP_DATE_ datetime(3),
825 TENANT_ID_ varchar(64),
Benjamin, Max (mb388a)d5968f52021-02-05 20:34:11 -0500826 REMOVAL_TIME_ datetime(3),
Benjamin, Max (mb388a)5a6a6de2018-07-30 15:56:09 -0400827 primary key (ID_)
828) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE utf8_bin;
829
830create table ACT_HI_VARINST (
831 ID_ varchar(64) not null,
832 PROC_DEF_KEY_ varchar(255),
833 PROC_DEF_ID_ varchar(64),
Benjamin, Max (mb388a)d5968f52021-02-05 20:34:11 -0500834 ROOT_PROC_INST_ID_ varchar(64),
Benjamin, Max (mb388a)5a6a6de2018-07-30 15:56:09 -0400835 PROC_INST_ID_ varchar(64),
836 EXECUTION_ID_ varchar(64),
837 ACT_INST_ID_ varchar(64),
838 CASE_DEF_KEY_ varchar(255),
839 CASE_DEF_ID_ varchar(64),
840 CASE_INST_ID_ varchar(64),
841 CASE_EXECUTION_ID_ varchar(64),
842 TASK_ID_ varchar(64),
843 NAME_ varchar(255) not null,
844 VAR_TYPE_ varchar(100),
Benjamin, Max (mb388a)d5968f52021-02-05 20:34:11 -0500845 CREATE_TIME_ datetime(3),
Benjamin, Max (mb388a)5a6a6de2018-07-30 15:56:09 -0400846 REV_ integer,
847 BYTEARRAY_ID_ varchar(64),
848 DOUBLE_ double,
849 LONG_ bigint,
Benjamin, Max (mb388a)d5968f52021-02-05 20:34:11 -0500850 TEXT_ varchar(4000),
851 TEXT2_ varchar(4000),
Benjamin, Max (mb388a)5a6a6de2018-07-30 15:56:09 -0400852 TENANT_ID_ varchar(64),
853 STATE_ varchar(20),
Benjamin, Max (mb388a)d5968f52021-02-05 20:34:11 -0500854 REMOVAL_TIME_ datetime(3),
Benjamin, Max (mb388a)5a6a6de2018-07-30 15:56:09 -0400855 primary key (ID_)
856) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE utf8_bin;
857
858create table ACT_HI_DETAIL (
859 ID_ varchar(64) not null,
860 TYPE_ varchar(255) not null,
861 PROC_DEF_KEY_ varchar(255),
862 PROC_DEF_ID_ varchar(64),
Benjamin, Max (mb388a)d5968f52021-02-05 20:34:11 -0500863 ROOT_PROC_INST_ID_ varchar(64),
Benjamin, Max (mb388a)5a6a6de2018-07-30 15:56:09 -0400864 PROC_INST_ID_ varchar(64),
865 EXECUTION_ID_ varchar(64),
866 CASE_DEF_KEY_ varchar(255),
867 CASE_DEF_ID_ varchar(64),
868 CASE_INST_ID_ varchar(64),
869 CASE_EXECUTION_ID_ varchar(64),
870 TASK_ID_ varchar(64),
871 ACT_INST_ID_ varchar(64),
872 VAR_INST_ID_ varchar(64),
873 NAME_ varchar(255) not null,
874 VAR_TYPE_ varchar(255),
875 REV_ integer,
876 TIME_ datetime(3) not null,
877 BYTEARRAY_ID_ varchar(64),
878 DOUBLE_ double,
879 LONG_ bigint,
Benjamin, Max (mb388a)d5968f52021-02-05 20:34:11 -0500880 TEXT_ varchar(4000),
881 TEXT2_ varchar(4000),
Benjamin, Max (mb388a)5a6a6de2018-07-30 15:56:09 -0400882 SEQUENCE_COUNTER_ bigint,
883 TENANT_ID_ varchar(64),
884 OPERATION_ID_ varchar(64),
Benjamin, Max (mb388a)d5968f52021-02-05 20:34:11 -0500885 REMOVAL_TIME_ datetime(3),
886 INITIAL_ boolean,
Benjamin, Max (mb388a)5a6a6de2018-07-30 15:56:09 -0400887 primary key (ID_)
888) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE utf8_bin;
889
890create table ACT_HI_IDENTITYLINK (
891 ID_ varchar(64) not null,
892 TIMESTAMP_ timestamp(3) not null,
893 TYPE_ varchar(255),
894 USER_ID_ varchar(255),
895 GROUP_ID_ varchar(255),
896 TASK_ID_ varchar(64),
Benjamin, Max (mb388a)d5968f52021-02-05 20:34:11 -0500897 ROOT_PROC_INST_ID_ varchar(64),
Benjamin, Max (mb388a)5a6a6de2018-07-30 15:56:09 -0400898 PROC_DEF_ID_ varchar(64),
899 OPERATION_TYPE_ varchar(64),
900 ASSIGNER_ID_ varchar(64),
901 PROC_DEF_KEY_ varchar(255),
902 TENANT_ID_ varchar(64),
Benjamin, Max (mb388a)d5968f52021-02-05 20:34:11 -0500903 REMOVAL_TIME_ datetime(3),
Benjamin, Max (mb388a)5a6a6de2018-07-30 15:56:09 -0400904 primary key (ID_)
905) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE utf8_bin;
906
907create table ACT_HI_COMMENT (
908 ID_ varchar(64) not null,
909 TYPE_ varchar(255),
910 TIME_ datetime(3) not null,
911 USER_ID_ varchar(255),
912 TASK_ID_ varchar(64),
Benjamin, Max (mb388a)d5968f52021-02-05 20:34:11 -0500913 ROOT_PROC_INST_ID_ varchar(64),
Benjamin, Max (mb388a)5a6a6de2018-07-30 15:56:09 -0400914 PROC_INST_ID_ varchar(64),
915 ACTION_ varchar(255),
916 MESSAGE_ varchar(4000),
917 FULL_MSG_ LONGBLOB,
918 TENANT_ID_ varchar(64),
Benjamin, Max (mb388a)d5968f52021-02-05 20:34:11 -0500919 REMOVAL_TIME_ datetime(3),
Benjamin, Max (mb388a)5a6a6de2018-07-30 15:56:09 -0400920 primary key (ID_)
921) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE utf8_bin;
922
923create table ACT_HI_ATTACHMENT (
924 ID_ varchar(64) not null,
925 REV_ integer,
926 USER_ID_ varchar(255),
927 NAME_ varchar(255),
928 DESCRIPTION_ varchar(4000),
929 TYPE_ varchar(255),
930 TASK_ID_ varchar(64),
Benjamin, Max (mb388a)d5968f52021-02-05 20:34:11 -0500931 ROOT_PROC_INST_ID_ varchar(64),
Benjamin, Max (mb388a)5a6a6de2018-07-30 15:56:09 -0400932 PROC_INST_ID_ varchar(64),
933 URL_ varchar(4000),
934 CONTENT_ID_ varchar(64),
935 TENANT_ID_ varchar(64),
Benjamin, Max (mb388a)d5968f52021-02-05 20:34:11 -0500936 CREATE_TIME_ datetime(3),
937 REMOVAL_TIME_ datetime(3),
Benjamin, Max (mb388a)5a6a6de2018-07-30 15:56:09 -0400938 primary key (ID_)
939) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE utf8_bin;
940
941create table ACT_HI_OP_LOG (
942 ID_ varchar(64) not null,
943 DEPLOYMENT_ID_ varchar(64),
944 PROC_DEF_ID_ varchar(64),
945 PROC_DEF_KEY_ varchar(255),
Benjamin, Max (mb388a)d5968f52021-02-05 20:34:11 -0500946 ROOT_PROC_INST_ID_ varchar(64),
Benjamin, Max (mb388a)5a6a6de2018-07-30 15:56:09 -0400947 PROC_INST_ID_ varchar(64),
948 EXECUTION_ID_ varchar(64),
949 CASE_DEF_ID_ varchar(64),
950 CASE_INST_ID_ varchar(64),
951 CASE_EXECUTION_ID_ varchar(64),
952 TASK_ID_ varchar(64),
953 JOB_ID_ varchar(64),
954 JOB_DEF_ID_ varchar(64),
955 BATCH_ID_ varchar(64),
956 USER_ID_ varchar(255),
957 TIMESTAMP_ timestamp(3) not null,
958 OPERATION_TYPE_ varchar(64),
959 OPERATION_ID_ varchar(64),
960 ENTITY_TYPE_ varchar(30),
961 PROPERTY_ varchar(64),
962 ORG_VALUE_ varchar(4000),
963 NEW_VALUE_ varchar(4000),
964 TENANT_ID_ varchar(64),
Benjamin, Max (mb388a)d5968f52021-02-05 20:34:11 -0500965 REMOVAL_TIME_ datetime(3),
966 CATEGORY_ varchar(64),
967 EXTERNAL_TASK_ID_ varchar(64),
968 ANNOTATION_ varchar(4000),
Benjamin, Max (mb388a)5a6a6de2018-07-30 15:56:09 -0400969 primary key (ID_)
970) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE utf8_bin;
971
972create table ACT_HI_INCIDENT (
973 ID_ varchar(64) not null,
974 PROC_DEF_KEY_ varchar(255),
975 PROC_DEF_ID_ varchar(64),
Benjamin, Max (mb388a)d5968f52021-02-05 20:34:11 -0500976 ROOT_PROC_INST_ID_ varchar(64),
Benjamin, Max (mb388a)5a6a6de2018-07-30 15:56:09 -0400977 PROC_INST_ID_ varchar(64),
978 EXECUTION_ID_ varchar(64),
979 CREATE_TIME_ timestamp(3) not null,
980 END_TIME_ timestamp(3) null,
981 INCIDENT_MSG_ varchar(4000),
982 INCIDENT_TYPE_ varchar(255) not null,
983 ACTIVITY_ID_ varchar(255),
Benjamin, Max (mb388a)d5968f52021-02-05 20:34:11 -0500984 FAILED_ACTIVITY_ID_ varchar(255),
Benjamin, Max (mb388a)5a6a6de2018-07-30 15:56:09 -0400985 CAUSE_INCIDENT_ID_ varchar(64),
986 ROOT_CAUSE_INCIDENT_ID_ varchar(64),
987 CONFIGURATION_ varchar(255),
Benjamin, Max (mb388a)d5968f52021-02-05 20:34:11 -0500988 HISTORY_CONFIGURATION_ varchar(255),
Benjamin, Max (mb388a)5a6a6de2018-07-30 15:56:09 -0400989 INCIDENT_STATE_ integer,
990 TENANT_ID_ varchar(64),
991 JOB_DEF_ID_ varchar(64),
Benjamin, Max (mb388a)d5968f52021-02-05 20:34:11 -0500992 REMOVAL_TIME_ datetime(3),
Benjamin, Max (mb388a)5a6a6de2018-07-30 15:56:09 -0400993 primary key (ID_)
994) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE utf8_bin;
995
996create table ACT_HI_JOB_LOG (
997 ID_ varchar(64) not null,
Benjamin, Max (mb388a)d5968f52021-02-05 20:34:11 -0500998 TIMESTAMP_ datetime(3) not null,
Benjamin, Max (mb388a)5a6a6de2018-07-30 15:56:09 -0400999 JOB_ID_ varchar(64) not null,
Benjamin, Max (mb388a)d5968f52021-02-05 20:34:11 -05001000 JOB_DUEDATE_ datetime(3) NULL,
Benjamin, Max (mb388a)5a6a6de2018-07-30 15:56:09 -04001001 JOB_RETRIES_ integer,
1002 JOB_PRIORITY_ bigint NOT NULL DEFAULT 0,
1003 JOB_EXCEPTION_MSG_ varchar(4000),
1004 JOB_EXCEPTION_STACK_ID_ varchar(64),
1005 JOB_STATE_ integer,
1006 JOB_DEF_ID_ varchar(64),
1007 JOB_DEF_TYPE_ varchar(255),
1008 JOB_DEF_CONFIGURATION_ varchar(255),
1009 ACT_ID_ varchar(255),
Benjamin, Max (mb388a)d5968f52021-02-05 20:34:11 -05001010 FAILED_ACT_ID_ varchar(255),
1011 ROOT_PROC_INST_ID_ varchar(64),
Benjamin, Max (mb388a)5a6a6de2018-07-30 15:56:09 -04001012 EXECUTION_ID_ varchar(64),
1013 PROCESS_INSTANCE_ID_ varchar(64),
1014 PROCESS_DEF_ID_ varchar(64),
1015 PROCESS_DEF_KEY_ varchar(255),
1016 DEPLOYMENT_ID_ varchar(64),
1017 SEQUENCE_COUNTER_ bigint,
1018 TENANT_ID_ varchar(64),
Benjamin, Max (mb388a)d5968f52021-02-05 20:34:11 -05001019 HOSTNAME_ varchar(255),
1020 REMOVAL_TIME_ datetime(3),
Benjamin, Max (mb388a)5a6a6de2018-07-30 15:56:09 -04001021 primary key (ID_)
1022) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE utf8_bin;
1023
1024create table ACT_HI_BATCH (
1025 ID_ varchar(64) not null,
1026 TYPE_ varchar(255),
1027 TOTAL_JOBS_ integer,
1028 JOBS_PER_SEED_ integer,
1029 INVOCATIONS_PER_JOB_ integer,
1030 SEED_JOB_DEF_ID_ varchar(64),
1031 MONITOR_JOB_DEF_ID_ varchar(64),
1032 BATCH_JOB_DEF_ID_ varchar(64),
1033 TENANT_ID_ varchar(64),
Benjamin, Max (mb388a)d5968f52021-02-05 20:34:11 -05001034 CREATE_USER_ID_ varchar(255),
Benjamin, Max (mb388a)5a6a6de2018-07-30 15:56:09 -04001035 START_TIME_ datetime(3) not null,
1036 END_TIME_ datetime(3),
Benjamin, Max (mb388a)d5968f52021-02-05 20:34:11 -05001037 REMOVAL_TIME_ datetime(3),
Benjamin, Max (mb388a)5a6a6de2018-07-30 15:56:09 -04001038 primary key (ID_)
1039) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE utf8_bin;
1040
1041create table ACT_HI_EXT_TASK_LOG (
1042 ID_ varchar(64) not null,
1043 TIMESTAMP_ timestamp(3) not null,
1044 EXT_TASK_ID_ varchar(64) not null,
1045 RETRIES_ integer,
1046 TOPIC_NAME_ varchar(255),
1047 WORKER_ID_ varchar(255),
1048 PRIORITY_ bigint NOT NULL DEFAULT 0,
1049 ERROR_MSG_ varchar(4000),
1050 ERROR_DETAILS_ID_ varchar(64),
1051 ACT_ID_ varchar(255),
1052 ACT_INST_ID_ varchar(64),
1053 EXECUTION_ID_ varchar(64),
Benjamin, Max (mb388a)d5968f52021-02-05 20:34:11 -05001054 ROOT_PROC_INST_ID_ varchar(64),
Benjamin, Max (mb388a)5a6a6de2018-07-30 15:56:09 -04001055 PROC_INST_ID_ varchar(64),
1056 PROC_DEF_ID_ varchar(64),
1057 PROC_DEF_KEY_ varchar(255),
1058 TENANT_ID_ varchar(64),
1059 STATE_ integer,
Benjamin, Max (mb388a)d5968f52021-02-05 20:34:11 -05001060 REMOVAL_TIME_ datetime(3),
Benjamin, Max (mb388a)5a6a6de2018-07-30 15:56:09 -04001061 primary key (ID_)
1062) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE utf8_bin;
1063
1064create index ACT_IDX_HI_PRO_INST_END on ACT_HI_PROCINST(END_TIME_);
1065create index ACT_IDX_HI_PRO_I_BUSKEY on ACT_HI_PROCINST(BUSINESS_KEY_);
1066create index ACT_IDX_HI_PRO_INST_TENANT_ID on ACT_HI_PROCINST(TENANT_ID_);
1067create index ACT_IDX_HI_PRO_INST_PROC_DEF_KEY on ACT_HI_PROCINST(PROC_DEF_KEY_);
Benjamin, Max (mb388a)d5968f52021-02-05 20:34:11 -05001068create index ACT_IDX_HI_PRO_INST_PROC_TIME on ACT_HI_PROCINST(START_TIME_, END_TIME_);
1069create index ACT_IDX_HI_PI_PDEFID_END_TIME on ACT_HI_PROCINST(PROC_DEF_ID_, END_TIME_);
1070create index ACT_IDX_HI_PRO_INST_ROOT_PI on ACT_HI_PROCINST(ROOT_PROC_INST_ID_);
1071create index ACT_IDX_HI_PRO_INST_RM_TIME on ACT_HI_PROCINST(REMOVAL_TIME_);
Benjamin, Max (mb388a)5a6a6de2018-07-30 15:56:09 -04001072
Benjamin, Max (mb388a)d5968f52021-02-05 20:34:11 -05001073create index ACT_IDX_HI_ACTINST_ROOT_PI on ACT_HI_ACTINST(ROOT_PROC_INST_ID_);
1074create index ACT_IDX_HI_ACT_INST_START_END on ACT_HI_ACTINST(START_TIME_, END_TIME_);
Benjamin, Max (mb388a)5a6a6de2018-07-30 15:56:09 -04001075create index ACT_IDX_HI_ACT_INST_END on ACT_HI_ACTINST(END_TIME_);
1076create index ACT_IDX_HI_ACT_INST_PROCINST on ACT_HI_ACTINST(PROC_INST_ID_, ACT_ID_);
1077create index ACT_IDX_HI_ACT_INST_COMP on ACT_HI_ACTINST(EXECUTION_ID_, ACT_ID_, END_TIME_, ID_);
Benjamin, Max (mb388a)d5968f52021-02-05 20:34:11 -05001078create index ACT_IDX_HI_ACT_INST_STATS on ACT_HI_ACTINST(PROC_DEF_ID_, PROC_INST_ID_, ACT_ID_, END_TIME_, ACT_INST_STATE_);
Benjamin, Max (mb388a)5a6a6de2018-07-30 15:56:09 -04001079create index ACT_IDX_HI_ACT_INST_TENANT_ID on ACT_HI_ACTINST(TENANT_ID_);
1080create index ACT_IDX_HI_ACT_INST_PROC_DEF_KEY on ACT_HI_ACTINST(PROC_DEF_KEY_);
Benjamin, Max (mb388a)d5968f52021-02-05 20:34:11 -05001081create index ACT_IDX_HI_AI_PDEFID_END_TIME on ACT_HI_ACTINST(PROC_DEF_ID_, END_TIME_);
1082create index ACT_IDX_HI_ACT_INST_RM_TIME on ACT_HI_ACTINST(REMOVAL_TIME_);
Benjamin, Max (mb388a)5a6a6de2018-07-30 15:56:09 -04001083
Benjamin, Max (mb388a)d5968f52021-02-05 20:34:11 -05001084create index ACT_IDX_HI_TASKINST_ROOT_PI on ACT_HI_TASKINST(ROOT_PROC_INST_ID_);
Benjamin, Max (mb388a)5a6a6de2018-07-30 15:56:09 -04001085create index ACT_IDX_HI_TASK_INST_TENANT_ID on ACT_HI_TASKINST(TENANT_ID_);
1086create index ACT_IDX_HI_TASK_INST_PROC_DEF_KEY on ACT_HI_TASKINST(PROC_DEF_KEY_);
1087create index ACT_IDX_HI_TASKINST_PROCINST on ACT_HI_TASKINST(PROC_INST_ID_);
1088create index ACT_IDX_HI_TASKINSTID_PROCINST on ACT_HI_TASKINST(ID_,PROC_INST_ID_);
Benjamin, Max (mb388a)d5968f52021-02-05 20:34:11 -05001089create index ACT_IDX_HI_TASK_INST_RM_TIME on ACT_HI_TASKINST(REMOVAL_TIME_);
1090create index ACT_IDX_HI_TASK_INST_START on ACT_HI_TASKINST(START_TIME_);
1091create index ACT_IDX_HI_TASK_INST_END on ACT_HI_TASKINST(END_TIME_);
Benjamin, Max (mb388a)5a6a6de2018-07-30 15:56:09 -04001092
Benjamin, Max (mb388a)d5968f52021-02-05 20:34:11 -05001093create index ACT_IDX_HI_DETAIL_ROOT_PI on ACT_HI_DETAIL(ROOT_PROC_INST_ID_);
Benjamin, Max (mb388a)5a6a6de2018-07-30 15:56:09 -04001094create index ACT_IDX_HI_DETAIL_PROC_INST on ACT_HI_DETAIL(PROC_INST_ID_);
1095create index ACT_IDX_HI_DETAIL_ACT_INST on ACT_HI_DETAIL(ACT_INST_ID_);
1096create index ACT_IDX_HI_DETAIL_CASE_INST on ACT_HI_DETAIL(CASE_INST_ID_);
1097create index ACT_IDX_HI_DETAIL_CASE_EXEC on ACT_HI_DETAIL(CASE_EXECUTION_ID_);
1098create index ACT_IDX_HI_DETAIL_TIME on ACT_HI_DETAIL(TIME_);
1099create index ACT_IDX_HI_DETAIL_NAME on ACT_HI_DETAIL(NAME_);
1100create index ACT_IDX_HI_DETAIL_TASK_ID on ACT_HI_DETAIL(TASK_ID_);
1101create index ACT_IDX_HI_DETAIL_TENANT_ID on ACT_HI_DETAIL(TENANT_ID_);
1102create index ACT_IDX_HI_DETAIL_PROC_DEF_KEY on ACT_HI_DETAIL(PROC_DEF_KEY_);
1103create index ACT_IDX_HI_DETAIL_BYTEAR on ACT_HI_DETAIL(BYTEARRAY_ID_);
Benjamin, Max (mb388a)d5968f52021-02-05 20:34:11 -05001104create index ACT_IDX_HI_DETAIL_RM_TIME on ACT_HI_DETAIL(REMOVAL_TIME_);
1105create index ACT_IDX_HI_DETAIL_TASK_BYTEAR on ACT_HI_DETAIL(BYTEARRAY_ID_, TASK_ID_);
1106create index ACT_IDX_HI_DETAIL_VAR_INST_ID on ACT_HI_DETAIL(VAR_INST_ID_);
Benjamin, Max (mb388a)5a6a6de2018-07-30 15:56:09 -04001107
Benjamin, Max (mb388a)d5968f52021-02-05 20:34:11 -05001108create index ACT_IDX_HI_IDENT_LNK_ROOT_PI on ACT_HI_IDENTITYLINK(ROOT_PROC_INST_ID_);
Benjamin, Max (mb388a)5a6a6de2018-07-30 15:56:09 -04001109create index ACT_IDX_HI_IDENT_LNK_USER on ACT_HI_IDENTITYLINK(USER_ID_);
1110create index ACT_IDX_HI_IDENT_LNK_GROUP on ACT_HI_IDENTITYLINK(GROUP_ID_);
1111create index ACT_IDX_HI_IDENT_LNK_TENANT_ID on ACT_HI_IDENTITYLINK(TENANT_ID_);
1112create index ACT_IDX_HI_IDENT_LNK_PROC_DEF_KEY on ACT_HI_IDENTITYLINK(PROC_DEF_KEY_);
1113create index ACT_IDX_HI_IDENT_LINK_TASK on ACT_HI_IDENTITYLINK(TASK_ID_);
Benjamin, Max (mb388a)d5968f52021-02-05 20:34:11 -05001114create index ACT_IDX_HI_IDENT_LINK_RM_TIME on ACT_HI_IDENTITYLINK(REMOVAL_TIME_);
1115create index ACT_IDX_HI_IDENT_LNK_TIMESTAMP on ACT_HI_IDENTITYLINK(TIMESTAMP_);
Benjamin, Max (mb388a)5a6a6de2018-07-30 15:56:09 -04001116
Benjamin, Max (mb388a)d5968f52021-02-05 20:34:11 -05001117create index ACT_IDX_HI_VARINST_ROOT_PI on ACT_HI_VARINST(ROOT_PROC_INST_ID_);
Benjamin, Max (mb388a)5a6a6de2018-07-30 15:56:09 -04001118create index ACT_IDX_HI_PROCVAR_PROC_INST on ACT_HI_VARINST(PROC_INST_ID_);
1119create index ACT_IDX_HI_PROCVAR_NAME_TYPE on ACT_HI_VARINST(NAME_, VAR_TYPE_);
1120create index ACT_IDX_HI_CASEVAR_CASE_INST on ACT_HI_VARINST(CASE_INST_ID_);
1121create index ACT_IDX_HI_VAR_INST_TENANT_ID on ACT_HI_VARINST(TENANT_ID_);
1122create index ACT_IDX_HI_VAR_INST_PROC_DEF_KEY on ACT_HI_VARINST(PROC_DEF_KEY_);
1123create index ACT_IDX_HI_VARINST_BYTEAR on ACT_HI_VARINST(BYTEARRAY_ID_);
Benjamin, Max (mb388a)d5968f52021-02-05 20:34:11 -05001124create index ACT_IDX_HI_VARINST_RM_TIME on ACT_HI_VARINST(REMOVAL_TIME_);
1125create index ACT_IDX_HI_VAR_PI_NAME_TYPE on ACT_HI_VARINST(PROC_INST_ID_, NAME_, VAR_TYPE_);
Benjamin, Max (mb388a)5a6a6de2018-07-30 15:56:09 -04001126
1127create index ACT_IDX_HI_INCIDENT_TENANT_ID on ACT_HI_INCIDENT(TENANT_ID_);
1128create index ACT_IDX_HI_INCIDENT_PROC_DEF_KEY on ACT_HI_INCIDENT(PROC_DEF_KEY_);
Benjamin, Max (mb388a)d5968f52021-02-05 20:34:11 -05001129create index ACT_IDX_HI_INCIDENT_ROOT_PI on ACT_HI_INCIDENT(ROOT_PROC_INST_ID_);
Benjamin, Max (mb388a)5a6a6de2018-07-30 15:56:09 -04001130create index ACT_IDX_HI_INCIDENT_PROCINST on ACT_HI_INCIDENT(PROC_INST_ID_);
Benjamin, Max (mb388a)d5968f52021-02-05 20:34:11 -05001131create index ACT_IDX_HI_INCIDENT_RM_TIME on ACT_HI_INCIDENT(REMOVAL_TIME_);
1132create index ACT_IDX_HI_INCIDENT_CREATE_TIME on ACT_HI_INCIDENT(CREATE_TIME_);
1133create index ACT_IDX_HI_INCIDENT_END_TIME on ACT_HI_INCIDENT(END_TIME_);
Benjamin, Max (mb388a)5a6a6de2018-07-30 15:56:09 -04001134
Benjamin, Max (mb388a)d5968f52021-02-05 20:34:11 -05001135create index ACT_IDX_HI_JOB_LOG_ROOT_PI on ACT_HI_JOB_LOG(ROOT_PROC_INST_ID_);
Benjamin, Max (mb388a)5a6a6de2018-07-30 15:56:09 -04001136create index ACT_IDX_HI_JOB_LOG_PROCINST on ACT_HI_JOB_LOG(PROCESS_INSTANCE_ID_);
1137create index ACT_IDX_HI_JOB_LOG_PROCDEF on ACT_HI_JOB_LOG(PROCESS_DEF_ID_);
1138create index ACT_IDX_HI_JOB_LOG_TENANT_ID on ACT_HI_JOB_LOG(TENANT_ID_);
1139create index ACT_IDX_HI_JOB_LOG_JOB_DEF_ID on ACT_HI_JOB_LOG(JOB_DEF_ID_);
1140create index ACT_IDX_HI_JOB_LOG_PROC_DEF_KEY on ACT_HI_JOB_LOG(PROCESS_DEF_KEY_);
1141create index ACT_IDX_HI_JOB_LOG_EX_STACK on ACT_HI_JOB_LOG(JOB_EXCEPTION_STACK_ID_);
Benjamin, Max (mb388a)d5968f52021-02-05 20:34:11 -05001142create index ACT_IDX_HI_JOB_LOG_RM_TIME on ACT_HI_JOB_LOG(REMOVAL_TIME_);
1143create index ACT_IDX_HI_JOB_LOG_JOB_CONF on ACT_HI_JOB_LOG(JOB_DEF_CONFIGURATION_);
Benjamin, Max (mb388a)5a6a6de2018-07-30 15:56:09 -04001144
Benjamin, Max (mb388a)d5968f52021-02-05 20:34:11 -05001145create index ACT_HI_BAT_RM_TIME on ACT_HI_BATCH(REMOVAL_TIME_);
1146
1147create index ACT_HI_EXT_TASK_LOG_ROOT_PI on ACT_HI_EXT_TASK_LOG(ROOT_PROC_INST_ID_);
Benjamin, Max (mb388a)5a6a6de2018-07-30 15:56:09 -04001148create index ACT_HI_EXT_TASK_LOG_PROCINST on ACT_HI_EXT_TASK_LOG(PROC_INST_ID_);
1149create index ACT_HI_EXT_TASK_LOG_PROCDEF on ACT_HI_EXT_TASK_LOG(PROC_DEF_ID_);
1150create index ACT_HI_EXT_TASK_LOG_PROC_DEF_KEY on ACT_HI_EXT_TASK_LOG(PROC_DEF_KEY_);
1151create index ACT_HI_EXT_TASK_LOG_TENANT_ID on ACT_HI_EXT_TASK_LOG(TENANT_ID_);
1152create index ACT_IDX_HI_EXTTASKLOG_ERRORDET on ACT_HI_EXT_TASK_LOG(ERROR_DETAILS_ID_);
Benjamin, Max (mb388a)d5968f52021-02-05 20:34:11 -05001153create index ACT_HI_EXT_TASK_LOG_RM_TIME on ACT_HI_EXT_TASK_LOG(REMOVAL_TIME_);
Benjamin, Max (mb388a)5a6a6de2018-07-30 15:56:09 -04001154
Benjamin, Max (mb388a)d5968f52021-02-05 20:34:11 -05001155create index ACT_IDX_HI_OP_LOG_ROOT_PI on ACT_HI_OP_LOG(ROOT_PROC_INST_ID_);
Benjamin, Max (mb388a)5a6a6de2018-07-30 15:56:09 -04001156create index ACT_IDX_HI_OP_LOG_PROCINST on ACT_HI_OP_LOG(PROC_INST_ID_);
1157create index ACT_IDX_HI_OP_LOG_PROCDEF on ACT_HI_OP_LOG(PROC_DEF_ID_);
Benjamin, Max (mb388a)d5968f52021-02-05 20:34:11 -05001158create index ACT_IDX_HI_OP_LOG_TASK on ACT_HI_OP_LOG(TASK_ID_);
1159create index ACT_IDX_HI_OP_LOG_RM_TIME on ACT_HI_OP_LOG(REMOVAL_TIME_);
1160create index ACT_IDX_HI_OP_LOG_TIMESTAMP on ACT_HI_OP_LOG(TIMESTAMP_);
1161create index ACT_IDX_HI_OP_LOG_USER_ID on ACT_HI_OP_LOG(USER_ID_);
1162create index ACT_IDX_HI_OP_LOG_OP_TYPE on ACT_HI_OP_LOG(OPERATION_TYPE_);
1163create index ACT_IDX_HI_OP_LOG_ENTITY_TYPE on ACT_HI_OP_LOG(ENTITY_TYPE_);
Benjamin, Max (mb388a)5a6a6de2018-07-30 15:56:09 -04001164
1165create index ACT_IDX_HI_COMMENT_TASK on ACT_HI_COMMENT(TASK_ID_);
Benjamin, Max (mb388a)d5968f52021-02-05 20:34:11 -05001166create index ACT_IDX_HI_COMMENT_ROOT_PI on ACT_HI_COMMENT(ROOT_PROC_INST_ID_);
Benjamin, Max (mb388a)5a6a6de2018-07-30 15:56:09 -04001167create index ACT_IDX_HI_COMMENT_PROCINST on ACT_HI_COMMENT(PROC_INST_ID_);
Benjamin, Max (mb388a)d5968f52021-02-05 20:34:11 -05001168create index ACT_IDX_HI_COMMENT_RM_TIME on ACT_HI_COMMENT(REMOVAL_TIME_);
Benjamin, Max (mb388a)5a6a6de2018-07-30 15:56:09 -04001169
1170create index ACT_IDX_HI_ATTACHMENT_CONTENT on ACT_HI_ATTACHMENT(CONTENT_ID_);
Benjamin, Max (mb388a)d5968f52021-02-05 20:34:11 -05001171create index ACT_IDX_HI_ATTACHMENT_ROOT_PI on ACT_HI_ATTACHMENT(ROOT_PROC_INST_ID_);
Benjamin, Max (mb388a)5a6a6de2018-07-30 15:56:09 -04001172create index ACT_IDX_HI_ATTACHMENT_PROCINST on ACT_HI_ATTACHMENT(PROC_INST_ID_);
1173create index ACT_IDX_HI_ATTACHMENT_TASK on ACT_HI_ATTACHMENT(TASK_ID_);
Benjamin, Max (mb388a)d5968f52021-02-05 20:34:11 -05001174create index ACT_IDX_HI_ATTACHMENT_RM_TIME on ACT_HI_ATTACHMENT(REMOVAL_TIME_);
1175--
1176-- Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH
1177-- under one or more contributor license agreements. See the NOTICE file
1178-- distributed with this work for additional information regarding copyright
1179-- ownership. Camunda licenses this file to you under the Apache License,
1180-- Version 2.0; you may not use this file except in compliance with the License.
1181-- You may obtain a copy of the License at
1182--
1183-- http://www.apache.org/licenses/LICENSE-2.0
1184--
1185-- Unless required by applicable law or agreed to in writing, software
1186-- distributed under the License is distributed on an "AS IS" BASIS,
1187-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1188-- See the License for the specific language governing permissions and
1189-- limitations under the License.
1190--
1191
Benjamin, Max (mb388a)5a6a6de2018-07-30 15:56:09 -04001192create table ACT_HI_CASEINST (
1193 ID_ varchar(64) not null,
1194 CASE_INST_ID_ varchar(64) not null,
1195 BUSINESS_KEY_ varchar(255),
1196 CASE_DEF_ID_ varchar(64) not null,
1197 CREATE_TIME_ datetime(3) not null,
1198 CLOSE_TIME_ datetime(3),
1199 DURATION_ bigint,
1200 STATE_ integer,
1201 CREATE_USER_ID_ varchar(255),
1202 SUPER_CASE_INSTANCE_ID_ varchar(64),
1203 SUPER_PROCESS_INSTANCE_ID_ varchar(64),
1204 TENANT_ID_ varchar(64),
1205 primary key (ID_),
1206 unique (CASE_INST_ID_)
1207) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE utf8_bin;
1208
1209create table ACT_HI_CASEACTINST (
1210 ID_ varchar(64) not null,
1211 PARENT_ACT_INST_ID_ varchar(64),
1212 CASE_DEF_ID_ varchar(64) not null,
1213 CASE_INST_ID_ varchar(64) not null,
1214 CASE_ACT_ID_ varchar(255) not null,
1215 TASK_ID_ varchar(64),
1216 CALL_PROC_INST_ID_ varchar(64),
1217 CALL_CASE_INST_ID_ varchar(64),
1218 CASE_ACT_NAME_ varchar(255),
1219 CASE_ACT_TYPE_ varchar(255),
1220 CREATE_TIME_ datetime(3) not null,
1221 END_TIME_ datetime(3),
1222 DURATION_ bigint,
1223 STATE_ integer,
1224 REQUIRED_ boolean,
1225 TENANT_ID_ varchar(64),
1226 primary key (ID_)
1227) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE utf8_bin;
1228
1229create index ACT_IDX_HI_CAS_I_CLOSE on ACT_HI_CASEINST(CLOSE_TIME_);
1230create index ACT_IDX_HI_CAS_I_BUSKEY on ACT_HI_CASEINST(BUSINESS_KEY_);
1231create index ACT_IDX_HI_CAS_I_TENANT_ID on ACT_HI_CASEINST(TENANT_ID_);
1232create index ACT_IDX_HI_CAS_A_I_CREATE on ACT_HI_CASEACTINST(CREATE_TIME_);
1233create index ACT_IDX_HI_CAS_A_I_END on ACT_HI_CASEACTINST(END_TIME_);
1234create index ACT_IDX_HI_CAS_A_I_COMP on ACT_HI_CASEACTINST(CASE_ACT_ID_, END_TIME_, ID_);
1235create index ACT_IDX_HI_CAS_A_I_CASEINST on ACT_HI_CASEACTINST(CASE_INST_ID_, CASE_ACT_ID_);
1236create index ACT_IDX_HI_CAS_A_I_TENANT_ID on ACT_HI_CASEACTINST(TENANT_ID_);
Benjamin, Max (mb388a)d5968f52021-02-05 20:34:11 -05001237--
1238-- Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH
1239-- under one or more contributor license agreements. See the NOTICE file
1240-- distributed with this work for additional information regarding copyright
1241-- ownership. Camunda licenses this file to you under the Apache License,
1242-- Version 2.0; you may not use this file except in compliance with the License.
1243-- You may obtain a copy of the License at
1244--
1245-- http://www.apache.org/licenses/LICENSE-2.0
1246--
1247-- Unless required by applicable law or agreed to in writing, software
1248-- distributed under the License is distributed on an "AS IS" BASIS,
1249-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1250-- See the License for the specific language governing permissions and
1251-- limitations under the License.
1252--
1253
Benjamin, Max (mb388a)5a6a6de2018-07-30 15:56:09 -04001254-- create history decision instance table --
1255create table ACT_HI_DECINST (
1256 ID_ varchar(64) NOT NULL,
1257 DEC_DEF_ID_ varchar(64) NOT NULL,
1258 DEC_DEF_KEY_ varchar(255) NOT NULL,
1259 DEC_DEF_NAME_ varchar(255),
1260 PROC_DEF_KEY_ varchar(255),
1261 PROC_DEF_ID_ varchar(64),
1262 PROC_INST_ID_ varchar(64),
1263 CASE_DEF_KEY_ varchar(255),
1264 CASE_DEF_ID_ varchar(64),
1265 CASE_INST_ID_ varchar(64),
1266 ACT_INST_ID_ varchar(64),
1267 ACT_ID_ varchar(255),
1268 EVAL_TIME_ datetime(3) not null,
Benjamin, Max (mb388a)d5968f52021-02-05 20:34:11 -05001269 REMOVAL_TIME_ datetime(3),
Benjamin, Max (mb388a)5a6a6de2018-07-30 15:56:09 -04001270 COLLECT_VALUE_ double,
1271 USER_ID_ varchar(255),
1272 ROOT_DEC_INST_ID_ varchar(64),
Benjamin, Max (mb388a)d5968f52021-02-05 20:34:11 -05001273 ROOT_PROC_INST_ID_ varchar(64),
Benjamin, Max (mb388a)5a6a6de2018-07-30 15:56:09 -04001274 DEC_REQ_ID_ varchar(64),
1275 DEC_REQ_KEY_ varchar(255),
1276 TENANT_ID_ varchar(64),
1277 primary key (ID_)
1278) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE utf8_bin;
1279
1280-- create history decision input table --
1281create table ACT_HI_DEC_IN (
1282 ID_ varchar(64) NOT NULL,
1283 DEC_INST_ID_ varchar(64) NOT NULL,
1284 CLAUSE_ID_ varchar(64),
1285 CLAUSE_NAME_ varchar(255),
1286 VAR_TYPE_ varchar(100),
1287 BYTEARRAY_ID_ varchar(64),
1288 DOUBLE_ double,
1289 LONG_ bigint,
Benjamin, Max (mb388a)d5968f52021-02-05 20:34:11 -05001290 TEXT_ varchar(4000),
1291 TEXT2_ varchar(4000),
Benjamin, Max (mb388a)5a6a6de2018-07-30 15:56:09 -04001292 TENANT_ID_ varchar(64),
Benjamin, Max (mb388a)d5968f52021-02-05 20:34:11 -05001293 CREATE_TIME_ datetime(3),
1294 ROOT_PROC_INST_ID_ varchar(64),
1295 REMOVAL_TIME_ datetime(3),
Benjamin, Max (mb388a)5a6a6de2018-07-30 15:56:09 -04001296 primary key (ID_)
1297) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE utf8_bin;
1298
1299-- create history decision output table --
1300create table ACT_HI_DEC_OUT (
1301 ID_ varchar(64) NOT NULL,
1302 DEC_INST_ID_ varchar(64) NOT NULL,
1303 CLAUSE_ID_ varchar(64),
1304 CLAUSE_NAME_ varchar(255),
1305 RULE_ID_ varchar(64),
1306 RULE_ORDER_ integer,
1307 VAR_NAME_ varchar(255),
1308 VAR_TYPE_ varchar(100),
1309 BYTEARRAY_ID_ varchar(64),
1310 DOUBLE_ double,
1311 LONG_ bigint,
Benjamin, Max (mb388a)d5968f52021-02-05 20:34:11 -05001312 TEXT_ varchar(4000),
1313 TEXT2_ varchar(4000),
Benjamin, Max (mb388a)5a6a6de2018-07-30 15:56:09 -04001314 TENANT_ID_ varchar(64),
Benjamin, Max (mb388a)d5968f52021-02-05 20:34:11 -05001315 CREATE_TIME_ datetime(3),
1316 ROOT_PROC_INST_ID_ varchar(64),
1317 REMOVAL_TIME_ datetime(3),
Benjamin, Max (mb388a)5a6a6de2018-07-30 15:56:09 -04001318 primary key (ID_)
1319) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE utf8_bin;
1320
1321
1322create index ACT_IDX_HI_DEC_INST_ID on ACT_HI_DECINST(DEC_DEF_ID_);
1323create index ACT_IDX_HI_DEC_INST_KEY on ACT_HI_DECINST(DEC_DEF_KEY_);
1324create index ACT_IDX_HI_DEC_INST_PI on ACT_HI_DECINST(PROC_INST_ID_);
1325create index ACT_IDX_HI_DEC_INST_CI on ACT_HI_DECINST(CASE_INST_ID_);
1326create index ACT_IDX_HI_DEC_INST_ACT on ACT_HI_DECINST(ACT_ID_);
1327create index ACT_IDX_HI_DEC_INST_ACT_INST on ACT_HI_DECINST(ACT_INST_ID_);
1328create index ACT_IDX_HI_DEC_INST_TIME on ACT_HI_DECINST(EVAL_TIME_);
1329create index ACT_IDX_HI_DEC_INST_TENANT_ID on ACT_HI_DECINST(TENANT_ID_);
1330create index ACT_IDX_HI_DEC_INST_ROOT_ID on ACT_HI_DECINST(ROOT_DEC_INST_ID_);
1331create index ACT_IDX_HI_DEC_INST_REQ_ID on ACT_HI_DECINST(DEC_REQ_ID_);
1332create index ACT_IDX_HI_DEC_INST_REQ_KEY on ACT_HI_DECINST(DEC_REQ_KEY_);
Benjamin, Max (mb388a)d5968f52021-02-05 20:34:11 -05001333create index ACT_IDX_HI_DEC_INST_ROOT_PI on ACT_HI_DECINST(ROOT_PROC_INST_ID_);
1334create index ACT_IDX_HI_DEC_INST_RM_TIME on ACT_HI_DECINST(REMOVAL_TIME_);
Benjamin, Max (mb388a)5a6a6de2018-07-30 15:56:09 -04001335
1336
1337create index ACT_IDX_HI_DEC_IN_INST on ACT_HI_DEC_IN(DEC_INST_ID_);
1338create index ACT_IDX_HI_DEC_IN_CLAUSE on ACT_HI_DEC_IN(DEC_INST_ID_, CLAUSE_ID_);
Benjamin, Max (mb388a)d5968f52021-02-05 20:34:11 -05001339create index ACT_IDX_HI_DEC_IN_ROOT_PI on ACT_HI_DEC_IN(ROOT_PROC_INST_ID_);
1340create index ACT_IDX_HI_DEC_IN_RM_TIME on ACT_HI_DEC_IN(REMOVAL_TIME_);
Benjamin, Max (mb388a)5a6a6de2018-07-30 15:56:09 -04001341
1342create index ACT_IDX_HI_DEC_OUT_INST on ACT_HI_DEC_OUT(DEC_INST_ID_);
1343create index ACT_IDX_HI_DEC_OUT_RULE on ACT_HI_DEC_OUT(RULE_ORDER_, CLAUSE_ID_);
Benjamin, Max (mb388a)d5968f52021-02-05 20:34:11 -05001344create index ACT_IDX_HI_DEC_OUT_ROOT_PI on ACT_HI_DEC_OUT(ROOT_PROC_INST_ID_);
1345create index ACT_IDX_HI_DEC_OUT_RM_TIME on ACT_HI_DEC_OUT(REMOVAL_TIME_);