Benjamin, Max (mb388a) | 5a6a6de | 2018-07-30 15:56:09 -0400 | [diff] [blame] | 1 | |
| 2 | USE `camundabpmn`; |
| 3 | |
| 4 | |
| 5 | create 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) | d5968f5 | 2021-02-05 20:34:11 -0500 | [diff] [blame] | 12 | insert into ACT_GE_PROPERTY |
| 13 | values ('schema.version', 'fox', 1); |
| 14 | |
| 15 | insert into ACT_GE_PROPERTY |
| 16 | values ('schema.history', 'create(fox)', 1); |
| 17 | |
| 18 | insert into ACT_GE_PROPERTY |
| 19 | values ('next.dbid', '1', 1); |
| 20 | |
| 21 | insert into ACT_GE_PROPERTY |
| 22 | values ('deployment.lock', '0', 1); |
| 23 | |
| 24 | insert into ACT_GE_PROPERTY |
| 25 | values ('history.cleanup.job.lock', '0', 1); |
| 26 | |
| 27 | insert into ACT_GE_PROPERTY |
| 28 | values ('startup.lock', '0', 1); |
| 29 | |
| 30 | insert into ACT_GE_PROPERTY |
| 31 | values ('telemetry.lock', '0', 1); |
| 32 | |
| 33 | insert into ACT_GE_PROPERTY |
| 34 | values ('installationId.lock', '0', 1); |
Benjamin, Max (mb388a) | 5a6a6de | 2018-07-30 15:56:09 -0400 | [diff] [blame] | 35 | |
| 36 | create 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) | d5968f5 | 2021-02-05 20:34:11 -0500 | [diff] [blame] | 44 | TYPE_ integer, |
| 45 | CREATE_TIME_ datetime(3), |
| 46 | ROOT_PROC_INST_ID_ varchar(64), |
| 47 | REMOVAL_TIME_ datetime(3), |
Benjamin, Max (mb388a) | 5a6a6de | 2018-07-30 15:56:09 -0400 | [diff] [blame] | 48 | primary key (ID_) |
| 49 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE utf8_bin; |
| 50 | |
Benjamin, Max (mb388a) | d5968f5 | 2021-02-05 20:34:11 -0500 | [diff] [blame] | 51 | create 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 | |
| 58 | insert into ACT_GE_SCHEMA_LOG |
| 59 | values ('0', CURRENT_TIMESTAMP, '7.14.0'); |
| 60 | |
Benjamin, Max (mb388a) | 5a6a6de | 2018-07-30 15:56:09 -0400 | [diff] [blame] | 61 | create table ACT_RE_DEPLOYMENT ( |
| 62 | ID_ varchar(64), |
| 63 | NAME_ varchar(255), |
Benjamin, Max (mb388a) | d5968f5 | 2021-02-05 20:34:11 -0500 | [diff] [blame] | 64 | DEPLOY_TIME_ datetime(3), |
Benjamin, Max (mb388a) | 5a6a6de | 2018-07-30 15:56:09 -0400 | [diff] [blame] | 65 | SOURCE_ varchar(255), |
| 66 | TENANT_ID_ varchar(64), |
| 67 | primary key (ID_) |
| 68 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE utf8_bin; |
| 69 | |
| 70 | create table ACT_RU_EXECUTION ( |
| 71 | ID_ varchar(64), |
| 72 | REV_ integer, |
Benjamin, Max (mb388a) | d5968f5 | 2021-02-05 20:34:11 -0500 | [diff] [blame] | 73 | ROOT_PROC_INST_ID_ varchar(64), |
Benjamin, Max (mb388a) | 5a6a6de | 2018-07-30 15:56:09 -0400 | [diff] [blame] | 74 | 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 | |
| 94 | create table ACT_RU_JOB ( |
| 95 | ID_ varchar(64) NOT NULL, |
| 96 | REV_ integer, |
| 97 | TYPE_ varchar(255) NOT NULL, |
Benjamin, Max (mb388a) | d5968f5 | 2021-02-05 20:34:11 -0500 | [diff] [blame] | 98 | LOCK_EXP_TIME_ datetime(3) NULL, |
Benjamin, Max (mb388a) | 5a6a6de | 2018-07-30 15:56:09 -0400 | [diff] [blame] | 99 | 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) | d5968f5 | 2021-02-05 20:34:11 -0500 | [diff] [blame] | 108 | FAILED_ACT_ID_ varchar(255), |
| 109 | DUEDATE_ datetime(3) NULL, |
Benjamin, Max (mb388a) | 5a6a6de | 2018-07-30 15:56:09 -0400 | [diff] [blame] | 110 | REPEAT_ varchar(255), |
Benjamin, Max (mb388a) | d5968f5 | 2021-02-05 20:34:11 -0500 | [diff] [blame] | 111 | REPEAT_OFFSET_ bigint DEFAULT 0, |
Benjamin, Max (mb388a) | 5a6a6de | 2018-07-30 15:56:09 -0400 | [diff] [blame] | 112 | 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) | d5968f5 | 2021-02-05 20:34:11 -0500 | [diff] [blame] | 120 | CREATE_TIME_ datetime(3), |
Benjamin, Max (mb388a) | 5a6a6de | 2018-07-30 15:56:09 -0400 | [diff] [blame] | 121 | primary key (ID_) |
| 122 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE utf8_bin; |
| 123 | |
| 124 | create 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) | d5968f5 | 2021-02-05 20:34:11 -0500 | [diff] [blame] | 135 | DEPLOYMENT_ID_ varchar(64), |
Benjamin, Max (mb388a) | 5a6a6de | 2018-07-30 15:56:09 -0400 | [diff] [blame] | 136 | primary key (ID_) |
| 137 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE utf8_bin; |
| 138 | |
| 139 | create 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) | d5968f5 | 2021-02-05 20:34:11 -0500 | [diff] [blame] | 154 | STARTABLE_ boolean NOT NULL default TRUE, |
Benjamin, Max (mb388a) | 5a6a6de | 2018-07-30 15:56:09 -0400 | [diff] [blame] | 155 | primary key (ID_) |
| 156 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE utf8_bin; |
| 157 | |
| 158 | create 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) | d5968f5 | 2021-02-05 20:34:11 -0500 | [diff] [blame] | 175 | CREATE_TIME_ datetime(3), |
Benjamin, Max (mb388a) | 5a6a6de | 2018-07-30 15:56:09 -0400 | [diff] [blame] | 176 | 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 | |
| 183 | create 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 | |
| 195 | create 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) | d5968f5 | 2021-02-05 20:34:11 -0500 | [diff] [blame] | 202 | PROC_DEF_ID_ varchar(64), |
Benjamin, Max (mb388a) | 5a6a6de | 2018-07-30 15:56:09 -0400 | [diff] [blame] | 203 | CASE_EXECUTION_ID_ varchar(64), |
| 204 | CASE_INST_ID_ varchar(64), |
| 205 | TASK_ID_ varchar(64), |
Benjamin, Max (mb388a) | d5968f5 | 2021-02-05 20:34:11 -0500 | [diff] [blame] | 206 | BATCH_ID_ varchar(64), |
Benjamin, Max (mb388a) | 5a6a6de | 2018-07-30 15:56:09 -0400 | [diff] [blame] | 207 | BYTEARRAY_ID_ varchar(64), |
| 208 | DOUBLE_ double, |
| 209 | LONG_ bigint, |
Benjamin, Max (mb388a) | d5968f5 | 2021-02-05 20:34:11 -0500 | [diff] [blame] | 210 | TEXT_ varchar(4000), |
| 211 | TEXT2_ varchar(4000), |
Benjamin, Max (mb388a) | 5a6a6de | 2018-07-30 15:56:09 -0400 | [diff] [blame] | 212 | 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 | |
| 219 | create 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) | d5968f5 | 2021-02-05 20:34:11 -0500 | [diff] [blame] | 228 | CREATED_ datetime(3) not null, |
Benjamin, Max (mb388a) | 5a6a6de | 2018-07-30 15:56:09 -0400 | [diff] [blame] | 229 | TENANT_ID_ varchar(64), |
| 230 | primary key (ID_) |
| 231 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE utf8_bin; |
| 232 | |
| 233 | create table ACT_RU_INCIDENT ( |
| 234 | ID_ varchar(64) not null, |
| 235 | REV_ integer not null, |
Benjamin, Max (mb388a) | d5968f5 | 2021-02-05 20:34:11 -0500 | [diff] [blame] | 236 | INCIDENT_TIMESTAMP_ datetime(3) not null, |
Benjamin, Max (mb388a) | 5a6a6de | 2018-07-30 15:56:09 -0400 | [diff] [blame] | 237 | INCIDENT_MSG_ varchar(4000), |
| 238 | INCIDENT_TYPE_ varchar(255) not null, |
| 239 | EXECUTION_ID_ varchar(64), |
| 240 | ACTIVITY_ID_ varchar(255), |
Benjamin, Max (mb388a) | d5968f5 | 2021-02-05 20:34:11 -0500 | [diff] [blame] | 241 | FAILED_ACTIVITY_ID_ varchar(255), |
Benjamin, Max (mb388a) | 5a6a6de | 2018-07-30 15:56:09 -0400 | [diff] [blame] | 242 | 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 | |
| 252 | create 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) | d5968f5 | 2021-02-05 20:34:11 -0500 | [diff] [blame] | 261 | REMOVAL_TIME_ datetime(3), |
| 262 | ROOT_PROC_INST_ID_ varchar(64), |
Benjamin, Max (mb388a) | 5a6a6de | 2018-07-30 15:56:09 -0400 | [diff] [blame] | 263 | primary key (ID_) |
| 264 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE utf8_bin; |
| 265 | |
| 266 | create 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 | |
| 277 | create 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) | d5968f5 | 2021-02-05 20:34:11 -0500 | [diff] [blame] | 282 | TIMESTAMP_ datetime(3), |
Benjamin, Max (mb388a) | 5a6a6de | 2018-07-30 15:56:09 -0400 | [diff] [blame] | 283 | MILLISECONDS_ bigint DEFAULT 0, |
| 284 | primary key (ID_) |
| 285 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE utf8_bin; |
| 286 | |
| 287 | create 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) | d5968f5 | 2021-02-05 20:34:11 -0500 | [diff] [blame] | 295 | LOCK_EXP_TIME_ datetime(3) NULL, |
Benjamin, Max (mb388a) | 5a6a6de | 2018-07-30 15:56:09 -0400 | [diff] [blame] | 296 | 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 | |
| 308 | create 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) | d5968f5 | 2021-02-05 20:34:11 -0500 | [diff] [blame] | 322 | CREATE_USER_ID_ varchar(255), |
Benjamin, Max (mb388a) | 5a6a6de | 2018-07-30 15:56:09 -0400 | [diff] [blame] | 323 | primary key (ID_) |
| 324 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE utf8_bin; |
| 325 | |
Benjamin, Max (mb388a) | d5968f5 | 2021-02-05 20:34:11 -0500 | [diff] [blame] | 326 | create index ACT_IDX_EXEC_ROOT_PI on ACT_RU_EXECUTION(ROOT_PROC_INST_ID_); |
Benjamin, Max (mb388a) | 5a6a6de | 2018-07-30 15:56:09 -0400 | [diff] [blame] | 327 | create index ACT_IDX_EXEC_BUSKEY on ACT_RU_EXECUTION(BUSINESS_KEY_); |
| 328 | create index ACT_IDX_EXEC_TENANT_ID on ACT_RU_EXECUTION(TENANT_ID_); |
| 329 | create index ACT_IDX_TASK_CREATE on ACT_RU_TASK(CREATE_TIME_); |
| 330 | create index ACT_IDX_TASK_ASSIGNEE on ACT_RU_TASK(ASSIGNEE_); |
Benjamin, Max (mb388a) | d5968f5 | 2021-02-05 20:34:11 -0500 | [diff] [blame] | 331 | create index ACT_IDX_TASK_OWNER on ACT_RU_TASK(OWNER_); |
Benjamin, Max (mb388a) | 5a6a6de | 2018-07-30 15:56:09 -0400 | [diff] [blame] | 332 | create index ACT_IDX_TASK_TENANT_ID on ACT_RU_TASK(TENANT_ID_); |
| 333 | create index ACT_IDX_IDENT_LNK_USER on ACT_RU_IDENTITYLINK(USER_ID_); |
| 334 | create index ACT_IDX_IDENT_LNK_GROUP on ACT_RU_IDENTITYLINK(GROUP_ID_); |
| 335 | create index ACT_IDX_EVENT_SUBSCR_CONFIG_ on ACT_RU_EVENT_SUBSCR(CONFIGURATION_); |
| 336 | create index ACT_IDX_EVENT_SUBSCR_TENANT_ID on ACT_RU_EVENT_SUBSCR(TENANT_ID_); |
Benjamin, Max (mb388a) | d5968f5 | 2021-02-05 20:34:11 -0500 | [diff] [blame] | 337 | |
Benjamin, Max (mb388a) | 5a6a6de | 2018-07-30 15:56:09 -0400 | [diff] [blame] | 338 | create index ACT_IDX_VARIABLE_TASK_ID on ACT_RU_VARIABLE(TASK_ID_); |
| 339 | create index ACT_IDX_VARIABLE_TENANT_ID on ACT_RU_VARIABLE(TENANT_ID_); |
Benjamin, Max (mb388a) | d5968f5 | 2021-02-05 20:34:11 -0500 | [diff] [blame] | 340 | create index ACT_IDX_VARIABLE_TASK_NAME_TYPE on ACT_RU_VARIABLE(TASK_ID_, NAME_, TYPE_); |
| 341 | |
Benjamin, Max (mb388a) | 5a6a6de | 2018-07-30 15:56:09 -0400 | [diff] [blame] | 342 | create index ACT_IDX_ATHRZ_PROCEDEF on ACT_RU_IDENTITYLINK(PROC_DEF_ID_); |
| 343 | create index ACT_IDX_INC_CONFIGURATION on ACT_RU_INCIDENT(CONFIGURATION_); |
| 344 | create index ACT_IDX_INC_TENANT_ID on ACT_RU_INCIDENT(TENANT_ID_); |
| 345 | -- CAM-5914 |
| 346 | create index ACT_IDX_JOB_EXECUTION_ID on ACT_RU_JOB(EXECUTION_ID_); |
| 347 | -- this index needs to be limited in mariadb see CAM-6938 |
| 348 | create index ACT_IDX_JOB_HANDLER on ACT_RU_JOB(HANDLER_TYPE_(100),HANDLER_CFG_(155)); |
| 349 | create index ACT_IDX_JOB_PROCINST on ACT_RU_JOB(PROCESS_INSTANCE_ID_); |
| 350 | create index ACT_IDX_JOB_TENANT_ID on ACT_RU_JOB(TENANT_ID_); |
| 351 | create index ACT_IDX_JOBDEF_TENANT_ID on ACT_RU_JOBDEF(TENANT_ID_); |
| 352 | |
| 353 | -- new metric milliseconds column |
| 354 | CREATE INDEX ACT_IDX_METER_LOG_MS ON ACT_RU_METER_LOG(MILLISECONDS_); |
| 355 | CREATE INDEX ACT_IDX_METER_LOG_NAME_MS ON ACT_RU_METER_LOG(NAME_, MILLISECONDS_); |
| 356 | CREATE INDEX ACT_IDX_METER_LOG_REPORT ON ACT_RU_METER_LOG(NAME_, REPORTER_, MILLISECONDS_); |
| 357 | |
| 358 | -- old metric timestamp column |
| 359 | CREATE INDEX ACT_IDX_METER_LOG_TIME ON ACT_RU_METER_LOG(TIMESTAMP_); |
| 360 | CREATE INDEX ACT_IDX_METER_LOG ON ACT_RU_METER_LOG(NAME_, TIMESTAMP_); |
| 361 | |
| 362 | create index ACT_IDX_EXT_TASK_TOPIC on ACT_RU_EXT_TASK(TOPIC_NAME_); |
| 363 | create index ACT_IDX_EXT_TASK_TENANT_ID on ACT_RU_EXT_TASK(TENANT_ID_); |
| 364 | create index ACT_IDX_EXT_TASK_PRIORITY ON ACT_RU_EXT_TASK(PRIORITY_); |
| 365 | create index ACT_IDX_EXT_TASK_ERR_DETAILS ON ACT_RU_EXT_TASK(ERROR_DETAILS_ID_); |
| 366 | create index ACT_IDX_AUTH_GROUP_ID ON ACT_RU_AUTHORIZATION(GROUP_ID_); |
| 367 | create index ACT_IDX_JOB_JOB_DEF_ID on ACT_RU_JOB(JOB_DEF_ID_); |
| 368 | |
| 369 | alter table ACT_GE_BYTEARRAY |
| 370 | add constraint ACT_FK_BYTEARR_DEPL |
| 371 | foreign key (DEPLOYMENT_ID_) |
| 372 | references ACT_RE_DEPLOYMENT (ID_); |
| 373 | |
| 374 | alter 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 | |
| 379 | alter table ACT_RU_EXECUTION |
| 380 | add constraint ACT_FK_EXE_PARENT |
| 381 | foreign key (PARENT_ID_) |
| 382 | references ACT_RU_EXECUTION (ID_); |
| 383 | |
| 384 | alter table ACT_RU_EXECUTION |
| 385 | add constraint ACT_FK_EXE_SUPER |
| 386 | foreign key (SUPER_EXEC_) |
| 387 | references ACT_RU_EXECUTION (ID_); |
| 388 | |
| 389 | alter table ACT_RU_EXECUTION |
| 390 | add constraint ACT_FK_EXE_PROCDEF |
| 391 | foreign key (PROC_DEF_ID_) |
| 392 | references ACT_RE_PROCDEF (ID_); |
| 393 | |
| 394 | alter table ACT_RU_IDENTITYLINK |
| 395 | add constraint ACT_FK_TSKASS_TASK |
| 396 | foreign key (TASK_ID_) |
| 397 | references ACT_RU_TASK (ID_); |
| 398 | |
| 399 | alter table ACT_RU_IDENTITYLINK |
| 400 | add constraint ACT_FK_ATHRZ_PROCEDEF |
| 401 | foreign key (PROC_DEF_ID_) |
| 402 | references ACT_RE_PROCDEF(ID_); |
| 403 | |
| 404 | alter table ACT_RU_TASK |
| 405 | add constraint ACT_FK_TASK_EXE |
| 406 | foreign key (EXECUTION_ID_) |
| 407 | references ACT_RU_EXECUTION (ID_); |
| 408 | |
| 409 | alter table ACT_RU_TASK |
| 410 | add constraint ACT_FK_TASK_PROCINST |
| 411 | foreign key (PROC_INST_ID_) |
| 412 | references ACT_RU_EXECUTION (ID_); |
| 413 | |
| 414 | alter table ACT_RU_TASK |
| 415 | add constraint ACT_FK_TASK_PROCDEF |
| 416 | foreign key (PROC_DEF_ID_) |
| 417 | references ACT_RE_PROCDEF (ID_); |
| 418 | |
| 419 | alter table ACT_RU_VARIABLE |
| 420 | add constraint ACT_FK_VAR_EXE |
| 421 | foreign key (EXECUTION_ID_) |
| 422 | references ACT_RU_EXECUTION (ID_); |
| 423 | |
| 424 | alter table ACT_RU_VARIABLE |
| 425 | add constraint ACT_FK_VAR_PROCINST |
| 426 | foreign key (PROC_INST_ID_) |
| 427 | references ACT_RU_EXECUTION(ID_); |
| 428 | |
| 429 | alter table ACT_RU_VARIABLE |
| 430 | add constraint ACT_FK_VAR_BYTEARRAY |
| 431 | foreign key (BYTEARRAY_ID_) |
| 432 | references ACT_GE_BYTEARRAY (ID_); |
| 433 | |
| 434 | alter table ACT_RU_JOB |
| 435 | add constraint ACT_FK_JOB_EXCEPTION |
| 436 | foreign key (EXCEPTION_STACK_ID_) |
| 437 | references ACT_GE_BYTEARRAY (ID_); |
| 438 | |
| 439 | alter table ACT_RU_EVENT_SUBSCR |
| 440 | add constraint ACT_FK_EVENT_EXEC |
| 441 | foreign key (EXECUTION_ID_) |
| 442 | references ACT_RU_EXECUTION(ID_); |
| 443 | |
| 444 | alter table ACT_RU_INCIDENT |
| 445 | add constraint ACT_FK_INC_EXE |
| 446 | foreign key (EXECUTION_ID_) |
| 447 | references ACT_RU_EXECUTION (ID_); |
| 448 | |
| 449 | alter table ACT_RU_INCIDENT |
| 450 | add constraint ACT_FK_INC_PROCINST |
| 451 | foreign key (PROC_INST_ID_) |
| 452 | references ACT_RU_EXECUTION (ID_); |
| 453 | |
| 454 | alter table ACT_RU_INCIDENT |
| 455 | add constraint ACT_FK_INC_PROCDEF |
| 456 | foreign key (PROC_DEF_ID_) |
| 457 | references ACT_RE_PROCDEF (ID_); |
| 458 | |
| 459 | alter 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 | |
| 464 | alter 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 | |
| 469 | alter 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 | |
| 474 | create index ACT_IDX_INC_JOB_DEF on ACT_RU_INCIDENT(JOB_DEF_ID_); |
| 475 | alter 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 | |
| 480 | alter table ACT_RU_AUTHORIZATION |
| 481 | add constraint ACT_UNIQ_AUTH_USER |
| 482 | unique (USER_ID_,TYPE_,RESOURCE_TYPE_,RESOURCE_ID_); |
| 483 | |
| 484 | alter table ACT_RU_AUTHORIZATION |
| 485 | add constraint ACT_UNIQ_AUTH_GROUP |
| 486 | unique (GROUP_ID_,TYPE_,RESOURCE_TYPE_,RESOURCE_ID_); |
| 487 | |
| 488 | alter table ACT_RU_VARIABLE |
| 489 | add constraint ACT_UNIQ_VARIABLE |
| 490 | unique (VAR_SCOPE_, NAME_); |
| 491 | |
| 492 | alter 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 | |
| 497 | create index ACT_IDX_BATCH_SEED_JOB_DEF ON ACT_RU_BATCH(SEED_JOB_DEF_ID_); |
| 498 | alter 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 | |
| 503 | create index ACT_IDX_BATCH_MONITOR_JOB_DEF ON ACT_RU_BATCH(MONITOR_JOB_DEF_ID_); |
| 504 | alter 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 | |
| 509 | create index ACT_IDX_BATCH_JOB_DEF ON ACT_RU_BATCH(BATCH_JOB_DEF_ID_); |
| 510 | alter 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) | d5968f5 | 2021-02-05 20:34:11 -0500 | [diff] [blame] | 515 | create index ACT_IDX_BATCH_ID ON ACT_RU_VARIABLE(BATCH_ID_); |
| 516 | alter 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) | 5a6a6de | 2018-07-30 15:56:09 -0400 | [diff] [blame] | 521 | -- indexes for deadlock problems - https://app.camunda.com/jira/browse/CAM-2567 -- |
| 522 | create index ACT_IDX_INC_CAUSEINCID on ACT_RU_INCIDENT(CAUSE_INCIDENT_ID_); |
| 523 | create index ACT_IDX_INC_EXID on ACT_RU_INCIDENT(EXECUTION_ID_); |
| 524 | create index ACT_IDX_INC_PROCDEFID on ACT_RU_INCIDENT(PROC_DEF_ID_); |
| 525 | create index ACT_IDX_INC_PROCINSTID on ACT_RU_INCIDENT(PROC_INST_ID_); |
| 526 | create 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 -- |
| 528 | create 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 -- |
| 530 | create index ACT_IDX_EXT_TASK_EXEC on ACT_RU_EXT_TASK(EXECUTION_ID_); |
| 531 | |
| 532 | -- indexes to improve deployment |
Benjamin, Max (mb388a) | d5968f5 | 2021-02-05 20:34:11 -0500 | [diff] [blame] | 533 | create index ACT_IDX_BYTEARRAY_ROOT_PI on ACT_GE_BYTEARRAY(ROOT_PROC_INST_ID_); |
| 534 | create index ACT_IDX_BYTEARRAY_RM_TIME on ACT_GE_BYTEARRAY(REMOVAL_TIME_); |
Benjamin, Max (mb388a) | 5a6a6de | 2018-07-30 15:56:09 -0400 | [diff] [blame] | 535 | create index ACT_IDX_BYTEARRAY_NAME on ACT_GE_BYTEARRAY(NAME_); |
| 536 | create index ACT_IDX_DEPLOYMENT_NAME on ACT_RE_DEPLOYMENT(NAME_); |
| 537 | create index ACT_IDX_DEPLOYMENT_TENANT_ID on ACT_RE_DEPLOYMENT(TENANT_ID_); |
| 538 | create index ACT_IDX_JOBDEF_PROC_DEF_ID ON ACT_RU_JOBDEF(PROC_DEF_ID_); |
| 539 | create index ACT_IDX_JOB_HANDLER_TYPE ON ACT_RU_JOB(HANDLER_TYPE_); |
| 540 | create index ACT_IDX_EVENT_SUBSCR_EVT_NAME ON ACT_RU_EVENT_SUBSCR(EVENT_NAME_); |
| 541 | create index ACT_IDX_PROCDEF_DEPLOYMENT_ID ON ACT_RE_PROCDEF(DEPLOYMENT_ID_); |
| 542 | create index ACT_IDX_PROCDEF_TENANT_ID ON ACT_RE_PROCDEF(TENANT_ID_); |
| 543 | create index ACT_IDX_PROCDEF_VER_TAG ON ACT_RE_PROCDEF(VERSION_TAG_); |
Benjamin, Max (mb388a) | d5968f5 | 2021-02-05 20:34:11 -0500 | [diff] [blame] | 544 | |
| 545 | -- indices for history cleanup: https://jira.camunda.com/browse/CAM-11616 |
| 546 | create index ACT_IDX_AUTH_ROOT_PI on ACT_RU_AUTHORIZATION(ROOT_PROC_INST_ID_); |
| 547 | create 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) | 5a6a6de | 2018-07-30 15:56:09 -0400 | [diff] [blame] | 565 | -- create case definition table -- |
| 566 | create 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 -- |
| 582 | create 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 | |
| 601 | create 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 -- |
| 619 | create index ACT_IDX_CASE_EXEC_BUSKEY on ACT_RU_CASE_EXECUTION(BUSINESS_KEY_); |
| 620 | |
Benjamin, Max (mb388a) | d5968f5 | 2021-02-05 20:34:11 -0500 | [diff] [blame] | 621 | -- https://app.camunda.com/jira/browse/CAM-9165 |
| 622 | create index ACT_IDX_CASE_EXE_CASE_INST on ACT_RU_CASE_EXECUTION(CASE_INST_ID_); |
| 623 | |
Benjamin, Max (mb388a) | 5a6a6de | 2018-07-30 15:56:09 -0400 | [diff] [blame] | 624 | -- create foreign key constraints on ACT_RU_CASE_EXECUTION -- |
| 625 | alter 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 | |
| 630 | alter 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 | |
| 635 | alter 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 -- |
| 641 | alter 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 | |
| 646 | alter 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 -- |
| 652 | alter 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 | |
| 657 | alter 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 -- |
| 663 | alter 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 | |
| 668 | alter 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 | |
| 673 | create index ACT_IDX_CASE_DEF_TENANT_ID on ACT_RE_CASE_DEF(TENANT_ID_); |
| 674 | create index ACT_IDX_CASE_EXEC_TENANT_ID on ACT_RU_CASE_EXECUTION(TENANT_ID_); |
Benjamin, Max (mb388a) | d5968f5 | 2021-02-05 20:34:11 -0500 | [diff] [blame] | 675 | -- |
| 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) | 5a6a6de | 2018-07-30 15:56:09 -0400 | [diff] [blame] | 692 | -- create decision definition table -- |
| 693 | create 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 -- |
| 712 | create 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 | |
| 726 | alter 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 | |
| 731 | create index ACT_IDX_DEC_DEF_TENANT_ID on ACT_RE_DECISION_DEF(TENANT_ID_); |
| 732 | create index ACT_IDX_DEC_DEF_REQ_ID on ACT_RE_DECISION_DEF(DEC_REQ_ID_); |
| 733 | create index ACT_IDX_DEC_REQ_DEF_TENANT_ID on ACT_RE_DECISION_REQ_DEF(TENANT_ID_); |
Benjamin, Max (mb388a) | d5968f5 | 2021-02-05 20:34:11 -0500 | [diff] [blame] | 734 | -- |
| 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) | 5a6a6de | 2018-07-30 15:56:09 -0400 | [diff] [blame] | 751 | create 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) | d5968f5 | 2021-02-05 20:34:11 -0500 | [diff] [blame] | 759 | REMOVAL_TIME_ datetime(3), |
Benjamin, Max (mb388a) | 5a6a6de | 2018-07-30 15:56:09 -0400 | [diff] [blame] | 760 | 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) | d5968f5 | 2021-02-05 20:34:11 -0500 | [diff] [blame] | 765 | ROOT_PROC_INST_ID_ varchar(64), |
Benjamin, Max (mb388a) | 5a6a6de | 2018-07-30 15:56:09 -0400 | [diff] [blame] | 766 | 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 | |
| 775 | create 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) | d5968f5 | 2021-02-05 20:34:11 -0500 | [diff] [blame] | 780 | ROOT_PROC_INST_ID_ varchar(64), |
Benjamin, Max (mb388a) | 5a6a6de | 2018-07-30 15:56:09 -0400 | [diff] [blame] | 781 | 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) | d5968f5 | 2021-02-05 20:34:11 -0500 | [diff] [blame] | 789 | ASSIGNEE_ varchar(255), |
Benjamin, Max (mb388a) | 5a6a6de | 2018-07-30 15:56:09 -0400 | [diff] [blame] | 790 | 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) | d5968f5 | 2021-02-05 20:34:11 -0500 | [diff] [blame] | 796 | REMOVAL_TIME_ datetime(3), |
Benjamin, Max (mb388a) | 5a6a6de | 2018-07-30 15:56:09 -0400 | [diff] [blame] | 797 | primary key (ID_) |
| 798 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE utf8_bin; |
| 799 | |
| 800 | create 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) | d5968f5 | 2021-02-05 20:34:11 -0500 | [diff] [blame] | 805 | ROOT_PROC_INST_ID_ varchar(64), |
Benjamin, Max (mb388a) | 5a6a6de | 2018-07-30 15:56:09 -0400 | [diff] [blame] | 806 | 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) | d5968f5 | 2021-02-05 20:34:11 -0500 | [diff] [blame] | 826 | REMOVAL_TIME_ datetime(3), |
Benjamin, Max (mb388a) | 5a6a6de | 2018-07-30 15:56:09 -0400 | [diff] [blame] | 827 | primary key (ID_) |
| 828 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE utf8_bin; |
| 829 | |
| 830 | create 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) | d5968f5 | 2021-02-05 20:34:11 -0500 | [diff] [blame] | 834 | ROOT_PROC_INST_ID_ varchar(64), |
Benjamin, Max (mb388a) | 5a6a6de | 2018-07-30 15:56:09 -0400 | [diff] [blame] | 835 | 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) | d5968f5 | 2021-02-05 20:34:11 -0500 | [diff] [blame] | 845 | CREATE_TIME_ datetime(3), |
Benjamin, Max (mb388a) | 5a6a6de | 2018-07-30 15:56:09 -0400 | [diff] [blame] | 846 | REV_ integer, |
| 847 | BYTEARRAY_ID_ varchar(64), |
| 848 | DOUBLE_ double, |
| 849 | LONG_ bigint, |
Benjamin, Max (mb388a) | d5968f5 | 2021-02-05 20:34:11 -0500 | [diff] [blame] | 850 | TEXT_ varchar(4000), |
| 851 | TEXT2_ varchar(4000), |
Benjamin, Max (mb388a) | 5a6a6de | 2018-07-30 15:56:09 -0400 | [diff] [blame] | 852 | TENANT_ID_ varchar(64), |
| 853 | STATE_ varchar(20), |
Benjamin, Max (mb388a) | d5968f5 | 2021-02-05 20:34:11 -0500 | [diff] [blame] | 854 | REMOVAL_TIME_ datetime(3), |
Benjamin, Max (mb388a) | 5a6a6de | 2018-07-30 15:56:09 -0400 | [diff] [blame] | 855 | primary key (ID_) |
| 856 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE utf8_bin; |
| 857 | |
| 858 | create 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) | d5968f5 | 2021-02-05 20:34:11 -0500 | [diff] [blame] | 863 | ROOT_PROC_INST_ID_ varchar(64), |
Benjamin, Max (mb388a) | 5a6a6de | 2018-07-30 15:56:09 -0400 | [diff] [blame] | 864 | 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) | d5968f5 | 2021-02-05 20:34:11 -0500 | [diff] [blame] | 880 | TEXT_ varchar(4000), |
| 881 | TEXT2_ varchar(4000), |
Benjamin, Max (mb388a) | 5a6a6de | 2018-07-30 15:56:09 -0400 | [diff] [blame] | 882 | SEQUENCE_COUNTER_ bigint, |
| 883 | TENANT_ID_ varchar(64), |
| 884 | OPERATION_ID_ varchar(64), |
Benjamin, Max (mb388a) | d5968f5 | 2021-02-05 20:34:11 -0500 | [diff] [blame] | 885 | REMOVAL_TIME_ datetime(3), |
| 886 | INITIAL_ boolean, |
Benjamin, Max (mb388a) | 5a6a6de | 2018-07-30 15:56:09 -0400 | [diff] [blame] | 887 | primary key (ID_) |
| 888 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE utf8_bin; |
| 889 | |
| 890 | create 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) | d5968f5 | 2021-02-05 20:34:11 -0500 | [diff] [blame] | 897 | ROOT_PROC_INST_ID_ varchar(64), |
Benjamin, Max (mb388a) | 5a6a6de | 2018-07-30 15:56:09 -0400 | [diff] [blame] | 898 | 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) | d5968f5 | 2021-02-05 20:34:11 -0500 | [diff] [blame] | 903 | REMOVAL_TIME_ datetime(3), |
Benjamin, Max (mb388a) | 5a6a6de | 2018-07-30 15:56:09 -0400 | [diff] [blame] | 904 | primary key (ID_) |
| 905 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE utf8_bin; |
| 906 | |
| 907 | create 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) | d5968f5 | 2021-02-05 20:34:11 -0500 | [diff] [blame] | 913 | ROOT_PROC_INST_ID_ varchar(64), |
Benjamin, Max (mb388a) | 5a6a6de | 2018-07-30 15:56:09 -0400 | [diff] [blame] | 914 | 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) | d5968f5 | 2021-02-05 20:34:11 -0500 | [diff] [blame] | 919 | REMOVAL_TIME_ datetime(3), |
Benjamin, Max (mb388a) | 5a6a6de | 2018-07-30 15:56:09 -0400 | [diff] [blame] | 920 | primary key (ID_) |
| 921 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE utf8_bin; |
| 922 | |
| 923 | create 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) | d5968f5 | 2021-02-05 20:34:11 -0500 | [diff] [blame] | 931 | ROOT_PROC_INST_ID_ varchar(64), |
Benjamin, Max (mb388a) | 5a6a6de | 2018-07-30 15:56:09 -0400 | [diff] [blame] | 932 | PROC_INST_ID_ varchar(64), |
| 933 | URL_ varchar(4000), |
| 934 | CONTENT_ID_ varchar(64), |
| 935 | TENANT_ID_ varchar(64), |
Benjamin, Max (mb388a) | d5968f5 | 2021-02-05 20:34:11 -0500 | [diff] [blame] | 936 | CREATE_TIME_ datetime(3), |
| 937 | REMOVAL_TIME_ datetime(3), |
Benjamin, Max (mb388a) | 5a6a6de | 2018-07-30 15:56:09 -0400 | [diff] [blame] | 938 | primary key (ID_) |
| 939 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE utf8_bin; |
| 940 | |
| 941 | create 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) | d5968f5 | 2021-02-05 20:34:11 -0500 | [diff] [blame] | 946 | ROOT_PROC_INST_ID_ varchar(64), |
Benjamin, Max (mb388a) | 5a6a6de | 2018-07-30 15:56:09 -0400 | [diff] [blame] | 947 | 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) | d5968f5 | 2021-02-05 20:34:11 -0500 | [diff] [blame] | 965 | REMOVAL_TIME_ datetime(3), |
| 966 | CATEGORY_ varchar(64), |
| 967 | EXTERNAL_TASK_ID_ varchar(64), |
| 968 | ANNOTATION_ varchar(4000), |
Benjamin, Max (mb388a) | 5a6a6de | 2018-07-30 15:56:09 -0400 | [diff] [blame] | 969 | primary key (ID_) |
| 970 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE utf8_bin; |
| 971 | |
| 972 | create 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) | d5968f5 | 2021-02-05 20:34:11 -0500 | [diff] [blame] | 976 | ROOT_PROC_INST_ID_ varchar(64), |
Benjamin, Max (mb388a) | 5a6a6de | 2018-07-30 15:56:09 -0400 | [diff] [blame] | 977 | 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) | d5968f5 | 2021-02-05 20:34:11 -0500 | [diff] [blame] | 984 | FAILED_ACTIVITY_ID_ varchar(255), |
Benjamin, Max (mb388a) | 5a6a6de | 2018-07-30 15:56:09 -0400 | [diff] [blame] | 985 | CAUSE_INCIDENT_ID_ varchar(64), |
| 986 | ROOT_CAUSE_INCIDENT_ID_ varchar(64), |
| 987 | CONFIGURATION_ varchar(255), |
Benjamin, Max (mb388a) | d5968f5 | 2021-02-05 20:34:11 -0500 | [diff] [blame] | 988 | HISTORY_CONFIGURATION_ varchar(255), |
Benjamin, Max (mb388a) | 5a6a6de | 2018-07-30 15:56:09 -0400 | [diff] [blame] | 989 | INCIDENT_STATE_ integer, |
| 990 | TENANT_ID_ varchar(64), |
| 991 | JOB_DEF_ID_ varchar(64), |
Benjamin, Max (mb388a) | d5968f5 | 2021-02-05 20:34:11 -0500 | [diff] [blame] | 992 | REMOVAL_TIME_ datetime(3), |
Benjamin, Max (mb388a) | 5a6a6de | 2018-07-30 15:56:09 -0400 | [diff] [blame] | 993 | primary key (ID_) |
| 994 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE utf8_bin; |
| 995 | |
| 996 | create table ACT_HI_JOB_LOG ( |
| 997 | ID_ varchar(64) not null, |
Benjamin, Max (mb388a) | d5968f5 | 2021-02-05 20:34:11 -0500 | [diff] [blame] | 998 | TIMESTAMP_ datetime(3) not null, |
Benjamin, Max (mb388a) | 5a6a6de | 2018-07-30 15:56:09 -0400 | [diff] [blame] | 999 | JOB_ID_ varchar(64) not null, |
Benjamin, Max (mb388a) | d5968f5 | 2021-02-05 20:34:11 -0500 | [diff] [blame] | 1000 | JOB_DUEDATE_ datetime(3) NULL, |
Benjamin, Max (mb388a) | 5a6a6de | 2018-07-30 15:56:09 -0400 | [diff] [blame] | 1001 | 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) | d5968f5 | 2021-02-05 20:34:11 -0500 | [diff] [blame] | 1010 | FAILED_ACT_ID_ varchar(255), |
| 1011 | ROOT_PROC_INST_ID_ varchar(64), |
Benjamin, Max (mb388a) | 5a6a6de | 2018-07-30 15:56:09 -0400 | [diff] [blame] | 1012 | 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) | d5968f5 | 2021-02-05 20:34:11 -0500 | [diff] [blame] | 1019 | HOSTNAME_ varchar(255), |
| 1020 | REMOVAL_TIME_ datetime(3), |
Benjamin, Max (mb388a) | 5a6a6de | 2018-07-30 15:56:09 -0400 | [diff] [blame] | 1021 | primary key (ID_) |
| 1022 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE utf8_bin; |
| 1023 | |
| 1024 | create 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) | d5968f5 | 2021-02-05 20:34:11 -0500 | [diff] [blame] | 1034 | CREATE_USER_ID_ varchar(255), |
Benjamin, Max (mb388a) | 5a6a6de | 2018-07-30 15:56:09 -0400 | [diff] [blame] | 1035 | START_TIME_ datetime(3) not null, |
| 1036 | END_TIME_ datetime(3), |
Benjamin, Max (mb388a) | d5968f5 | 2021-02-05 20:34:11 -0500 | [diff] [blame] | 1037 | REMOVAL_TIME_ datetime(3), |
Benjamin, Max (mb388a) | 5a6a6de | 2018-07-30 15:56:09 -0400 | [diff] [blame] | 1038 | primary key (ID_) |
| 1039 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE utf8_bin; |
| 1040 | |
| 1041 | create 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) | d5968f5 | 2021-02-05 20:34:11 -0500 | [diff] [blame] | 1054 | ROOT_PROC_INST_ID_ varchar(64), |
Benjamin, Max (mb388a) | 5a6a6de | 2018-07-30 15:56:09 -0400 | [diff] [blame] | 1055 | 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) | d5968f5 | 2021-02-05 20:34:11 -0500 | [diff] [blame] | 1060 | REMOVAL_TIME_ datetime(3), |
Benjamin, Max (mb388a) | 5a6a6de | 2018-07-30 15:56:09 -0400 | [diff] [blame] | 1061 | primary key (ID_) |
| 1062 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE utf8_bin; |
| 1063 | |
| 1064 | create index ACT_IDX_HI_PRO_INST_END on ACT_HI_PROCINST(END_TIME_); |
| 1065 | create index ACT_IDX_HI_PRO_I_BUSKEY on ACT_HI_PROCINST(BUSINESS_KEY_); |
| 1066 | create index ACT_IDX_HI_PRO_INST_TENANT_ID on ACT_HI_PROCINST(TENANT_ID_); |
| 1067 | create index ACT_IDX_HI_PRO_INST_PROC_DEF_KEY on ACT_HI_PROCINST(PROC_DEF_KEY_); |
Benjamin, Max (mb388a) | d5968f5 | 2021-02-05 20:34:11 -0500 | [diff] [blame] | 1068 | create index ACT_IDX_HI_PRO_INST_PROC_TIME on ACT_HI_PROCINST(START_TIME_, END_TIME_); |
| 1069 | create index ACT_IDX_HI_PI_PDEFID_END_TIME on ACT_HI_PROCINST(PROC_DEF_ID_, END_TIME_); |
| 1070 | create index ACT_IDX_HI_PRO_INST_ROOT_PI on ACT_HI_PROCINST(ROOT_PROC_INST_ID_); |
| 1071 | create index ACT_IDX_HI_PRO_INST_RM_TIME on ACT_HI_PROCINST(REMOVAL_TIME_); |
Benjamin, Max (mb388a) | 5a6a6de | 2018-07-30 15:56:09 -0400 | [diff] [blame] | 1072 | |
Benjamin, Max (mb388a) | d5968f5 | 2021-02-05 20:34:11 -0500 | [diff] [blame] | 1073 | create index ACT_IDX_HI_ACTINST_ROOT_PI on ACT_HI_ACTINST(ROOT_PROC_INST_ID_); |
| 1074 | create index ACT_IDX_HI_ACT_INST_START_END on ACT_HI_ACTINST(START_TIME_, END_TIME_); |
Benjamin, Max (mb388a) | 5a6a6de | 2018-07-30 15:56:09 -0400 | [diff] [blame] | 1075 | create index ACT_IDX_HI_ACT_INST_END on ACT_HI_ACTINST(END_TIME_); |
| 1076 | create index ACT_IDX_HI_ACT_INST_PROCINST on ACT_HI_ACTINST(PROC_INST_ID_, ACT_ID_); |
| 1077 | create index ACT_IDX_HI_ACT_INST_COMP on ACT_HI_ACTINST(EXECUTION_ID_, ACT_ID_, END_TIME_, ID_); |
Benjamin, Max (mb388a) | d5968f5 | 2021-02-05 20:34:11 -0500 | [diff] [blame] | 1078 | create 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) | 5a6a6de | 2018-07-30 15:56:09 -0400 | [diff] [blame] | 1079 | create index ACT_IDX_HI_ACT_INST_TENANT_ID on ACT_HI_ACTINST(TENANT_ID_); |
| 1080 | create index ACT_IDX_HI_ACT_INST_PROC_DEF_KEY on ACT_HI_ACTINST(PROC_DEF_KEY_); |
Benjamin, Max (mb388a) | d5968f5 | 2021-02-05 20:34:11 -0500 | [diff] [blame] | 1081 | create index ACT_IDX_HI_AI_PDEFID_END_TIME on ACT_HI_ACTINST(PROC_DEF_ID_, END_TIME_); |
| 1082 | create index ACT_IDX_HI_ACT_INST_RM_TIME on ACT_HI_ACTINST(REMOVAL_TIME_); |
Benjamin, Max (mb388a) | 5a6a6de | 2018-07-30 15:56:09 -0400 | [diff] [blame] | 1083 | |
Benjamin, Max (mb388a) | d5968f5 | 2021-02-05 20:34:11 -0500 | [diff] [blame] | 1084 | create index ACT_IDX_HI_TASKINST_ROOT_PI on ACT_HI_TASKINST(ROOT_PROC_INST_ID_); |
Benjamin, Max (mb388a) | 5a6a6de | 2018-07-30 15:56:09 -0400 | [diff] [blame] | 1085 | create index ACT_IDX_HI_TASK_INST_TENANT_ID on ACT_HI_TASKINST(TENANT_ID_); |
| 1086 | create index ACT_IDX_HI_TASK_INST_PROC_DEF_KEY on ACT_HI_TASKINST(PROC_DEF_KEY_); |
| 1087 | create index ACT_IDX_HI_TASKINST_PROCINST on ACT_HI_TASKINST(PROC_INST_ID_); |
| 1088 | create index ACT_IDX_HI_TASKINSTID_PROCINST on ACT_HI_TASKINST(ID_,PROC_INST_ID_); |
Benjamin, Max (mb388a) | d5968f5 | 2021-02-05 20:34:11 -0500 | [diff] [blame] | 1089 | create index ACT_IDX_HI_TASK_INST_RM_TIME on ACT_HI_TASKINST(REMOVAL_TIME_); |
| 1090 | create index ACT_IDX_HI_TASK_INST_START on ACT_HI_TASKINST(START_TIME_); |
| 1091 | create index ACT_IDX_HI_TASK_INST_END on ACT_HI_TASKINST(END_TIME_); |
Benjamin, Max (mb388a) | 5a6a6de | 2018-07-30 15:56:09 -0400 | [diff] [blame] | 1092 | |
Benjamin, Max (mb388a) | d5968f5 | 2021-02-05 20:34:11 -0500 | [diff] [blame] | 1093 | create index ACT_IDX_HI_DETAIL_ROOT_PI on ACT_HI_DETAIL(ROOT_PROC_INST_ID_); |
Benjamin, Max (mb388a) | 5a6a6de | 2018-07-30 15:56:09 -0400 | [diff] [blame] | 1094 | create index ACT_IDX_HI_DETAIL_PROC_INST on ACT_HI_DETAIL(PROC_INST_ID_); |
| 1095 | create index ACT_IDX_HI_DETAIL_ACT_INST on ACT_HI_DETAIL(ACT_INST_ID_); |
| 1096 | create index ACT_IDX_HI_DETAIL_CASE_INST on ACT_HI_DETAIL(CASE_INST_ID_); |
| 1097 | create index ACT_IDX_HI_DETAIL_CASE_EXEC on ACT_HI_DETAIL(CASE_EXECUTION_ID_); |
| 1098 | create index ACT_IDX_HI_DETAIL_TIME on ACT_HI_DETAIL(TIME_); |
| 1099 | create index ACT_IDX_HI_DETAIL_NAME on ACT_HI_DETAIL(NAME_); |
| 1100 | create index ACT_IDX_HI_DETAIL_TASK_ID on ACT_HI_DETAIL(TASK_ID_); |
| 1101 | create index ACT_IDX_HI_DETAIL_TENANT_ID on ACT_HI_DETAIL(TENANT_ID_); |
| 1102 | create index ACT_IDX_HI_DETAIL_PROC_DEF_KEY on ACT_HI_DETAIL(PROC_DEF_KEY_); |
| 1103 | create index ACT_IDX_HI_DETAIL_BYTEAR on ACT_HI_DETAIL(BYTEARRAY_ID_); |
Benjamin, Max (mb388a) | d5968f5 | 2021-02-05 20:34:11 -0500 | [diff] [blame] | 1104 | create index ACT_IDX_HI_DETAIL_RM_TIME on ACT_HI_DETAIL(REMOVAL_TIME_); |
| 1105 | create index ACT_IDX_HI_DETAIL_TASK_BYTEAR on ACT_HI_DETAIL(BYTEARRAY_ID_, TASK_ID_); |
| 1106 | create index ACT_IDX_HI_DETAIL_VAR_INST_ID on ACT_HI_DETAIL(VAR_INST_ID_); |
Benjamin, Max (mb388a) | 5a6a6de | 2018-07-30 15:56:09 -0400 | [diff] [blame] | 1107 | |
Benjamin, Max (mb388a) | d5968f5 | 2021-02-05 20:34:11 -0500 | [diff] [blame] | 1108 | create index ACT_IDX_HI_IDENT_LNK_ROOT_PI on ACT_HI_IDENTITYLINK(ROOT_PROC_INST_ID_); |
Benjamin, Max (mb388a) | 5a6a6de | 2018-07-30 15:56:09 -0400 | [diff] [blame] | 1109 | create index ACT_IDX_HI_IDENT_LNK_USER on ACT_HI_IDENTITYLINK(USER_ID_); |
| 1110 | create index ACT_IDX_HI_IDENT_LNK_GROUP on ACT_HI_IDENTITYLINK(GROUP_ID_); |
| 1111 | create index ACT_IDX_HI_IDENT_LNK_TENANT_ID on ACT_HI_IDENTITYLINK(TENANT_ID_); |
| 1112 | create index ACT_IDX_HI_IDENT_LNK_PROC_DEF_KEY on ACT_HI_IDENTITYLINK(PROC_DEF_KEY_); |
| 1113 | create index ACT_IDX_HI_IDENT_LINK_TASK on ACT_HI_IDENTITYLINK(TASK_ID_); |
Benjamin, Max (mb388a) | d5968f5 | 2021-02-05 20:34:11 -0500 | [diff] [blame] | 1114 | create index ACT_IDX_HI_IDENT_LINK_RM_TIME on ACT_HI_IDENTITYLINK(REMOVAL_TIME_); |
| 1115 | create index ACT_IDX_HI_IDENT_LNK_TIMESTAMP on ACT_HI_IDENTITYLINK(TIMESTAMP_); |
Benjamin, Max (mb388a) | 5a6a6de | 2018-07-30 15:56:09 -0400 | [diff] [blame] | 1116 | |
Benjamin, Max (mb388a) | d5968f5 | 2021-02-05 20:34:11 -0500 | [diff] [blame] | 1117 | create index ACT_IDX_HI_VARINST_ROOT_PI on ACT_HI_VARINST(ROOT_PROC_INST_ID_); |
Benjamin, Max (mb388a) | 5a6a6de | 2018-07-30 15:56:09 -0400 | [diff] [blame] | 1118 | create index ACT_IDX_HI_PROCVAR_PROC_INST on ACT_HI_VARINST(PROC_INST_ID_); |
| 1119 | create index ACT_IDX_HI_PROCVAR_NAME_TYPE on ACT_HI_VARINST(NAME_, VAR_TYPE_); |
| 1120 | create index ACT_IDX_HI_CASEVAR_CASE_INST on ACT_HI_VARINST(CASE_INST_ID_); |
| 1121 | create index ACT_IDX_HI_VAR_INST_TENANT_ID on ACT_HI_VARINST(TENANT_ID_); |
| 1122 | create index ACT_IDX_HI_VAR_INST_PROC_DEF_KEY on ACT_HI_VARINST(PROC_DEF_KEY_); |
| 1123 | create index ACT_IDX_HI_VARINST_BYTEAR on ACT_HI_VARINST(BYTEARRAY_ID_); |
Benjamin, Max (mb388a) | d5968f5 | 2021-02-05 20:34:11 -0500 | [diff] [blame] | 1124 | create index ACT_IDX_HI_VARINST_RM_TIME on ACT_HI_VARINST(REMOVAL_TIME_); |
| 1125 | create index ACT_IDX_HI_VAR_PI_NAME_TYPE on ACT_HI_VARINST(PROC_INST_ID_, NAME_, VAR_TYPE_); |
Benjamin, Max (mb388a) | 5a6a6de | 2018-07-30 15:56:09 -0400 | [diff] [blame] | 1126 | |
| 1127 | create index ACT_IDX_HI_INCIDENT_TENANT_ID on ACT_HI_INCIDENT(TENANT_ID_); |
| 1128 | create index ACT_IDX_HI_INCIDENT_PROC_DEF_KEY on ACT_HI_INCIDENT(PROC_DEF_KEY_); |
Benjamin, Max (mb388a) | d5968f5 | 2021-02-05 20:34:11 -0500 | [diff] [blame] | 1129 | create index ACT_IDX_HI_INCIDENT_ROOT_PI on ACT_HI_INCIDENT(ROOT_PROC_INST_ID_); |
Benjamin, Max (mb388a) | 5a6a6de | 2018-07-30 15:56:09 -0400 | [diff] [blame] | 1130 | create index ACT_IDX_HI_INCIDENT_PROCINST on ACT_HI_INCIDENT(PROC_INST_ID_); |
Benjamin, Max (mb388a) | d5968f5 | 2021-02-05 20:34:11 -0500 | [diff] [blame] | 1131 | create index ACT_IDX_HI_INCIDENT_RM_TIME on ACT_HI_INCIDENT(REMOVAL_TIME_); |
| 1132 | create index ACT_IDX_HI_INCIDENT_CREATE_TIME on ACT_HI_INCIDENT(CREATE_TIME_); |
| 1133 | create index ACT_IDX_HI_INCIDENT_END_TIME on ACT_HI_INCIDENT(END_TIME_); |
Benjamin, Max (mb388a) | 5a6a6de | 2018-07-30 15:56:09 -0400 | [diff] [blame] | 1134 | |
Benjamin, Max (mb388a) | d5968f5 | 2021-02-05 20:34:11 -0500 | [diff] [blame] | 1135 | create index ACT_IDX_HI_JOB_LOG_ROOT_PI on ACT_HI_JOB_LOG(ROOT_PROC_INST_ID_); |
Benjamin, Max (mb388a) | 5a6a6de | 2018-07-30 15:56:09 -0400 | [diff] [blame] | 1136 | create index ACT_IDX_HI_JOB_LOG_PROCINST on ACT_HI_JOB_LOG(PROCESS_INSTANCE_ID_); |
| 1137 | create index ACT_IDX_HI_JOB_LOG_PROCDEF on ACT_HI_JOB_LOG(PROCESS_DEF_ID_); |
| 1138 | create index ACT_IDX_HI_JOB_LOG_TENANT_ID on ACT_HI_JOB_LOG(TENANT_ID_); |
| 1139 | create index ACT_IDX_HI_JOB_LOG_JOB_DEF_ID on ACT_HI_JOB_LOG(JOB_DEF_ID_); |
| 1140 | create index ACT_IDX_HI_JOB_LOG_PROC_DEF_KEY on ACT_HI_JOB_LOG(PROCESS_DEF_KEY_); |
| 1141 | create index ACT_IDX_HI_JOB_LOG_EX_STACK on ACT_HI_JOB_LOG(JOB_EXCEPTION_STACK_ID_); |
Benjamin, Max (mb388a) | d5968f5 | 2021-02-05 20:34:11 -0500 | [diff] [blame] | 1142 | create index ACT_IDX_HI_JOB_LOG_RM_TIME on ACT_HI_JOB_LOG(REMOVAL_TIME_); |
| 1143 | create index ACT_IDX_HI_JOB_LOG_JOB_CONF on ACT_HI_JOB_LOG(JOB_DEF_CONFIGURATION_); |
Benjamin, Max (mb388a) | 5a6a6de | 2018-07-30 15:56:09 -0400 | [diff] [blame] | 1144 | |
Benjamin, Max (mb388a) | d5968f5 | 2021-02-05 20:34:11 -0500 | [diff] [blame] | 1145 | create index ACT_HI_BAT_RM_TIME on ACT_HI_BATCH(REMOVAL_TIME_); |
| 1146 | |
| 1147 | create index ACT_HI_EXT_TASK_LOG_ROOT_PI on ACT_HI_EXT_TASK_LOG(ROOT_PROC_INST_ID_); |
Benjamin, Max (mb388a) | 5a6a6de | 2018-07-30 15:56:09 -0400 | [diff] [blame] | 1148 | create index ACT_HI_EXT_TASK_LOG_PROCINST on ACT_HI_EXT_TASK_LOG(PROC_INST_ID_); |
| 1149 | create index ACT_HI_EXT_TASK_LOG_PROCDEF on ACT_HI_EXT_TASK_LOG(PROC_DEF_ID_); |
| 1150 | create index ACT_HI_EXT_TASK_LOG_PROC_DEF_KEY on ACT_HI_EXT_TASK_LOG(PROC_DEF_KEY_); |
| 1151 | create index ACT_HI_EXT_TASK_LOG_TENANT_ID on ACT_HI_EXT_TASK_LOG(TENANT_ID_); |
| 1152 | create index ACT_IDX_HI_EXTTASKLOG_ERRORDET on ACT_HI_EXT_TASK_LOG(ERROR_DETAILS_ID_); |
Benjamin, Max (mb388a) | d5968f5 | 2021-02-05 20:34:11 -0500 | [diff] [blame] | 1153 | create index ACT_HI_EXT_TASK_LOG_RM_TIME on ACT_HI_EXT_TASK_LOG(REMOVAL_TIME_); |
Benjamin, Max (mb388a) | 5a6a6de | 2018-07-30 15:56:09 -0400 | [diff] [blame] | 1154 | |
Benjamin, Max (mb388a) | d5968f5 | 2021-02-05 20:34:11 -0500 | [diff] [blame] | 1155 | create index ACT_IDX_HI_OP_LOG_ROOT_PI on ACT_HI_OP_LOG(ROOT_PROC_INST_ID_); |
Benjamin, Max (mb388a) | 5a6a6de | 2018-07-30 15:56:09 -0400 | [diff] [blame] | 1156 | create index ACT_IDX_HI_OP_LOG_PROCINST on ACT_HI_OP_LOG(PROC_INST_ID_); |
| 1157 | create index ACT_IDX_HI_OP_LOG_PROCDEF on ACT_HI_OP_LOG(PROC_DEF_ID_); |
Benjamin, Max (mb388a) | d5968f5 | 2021-02-05 20:34:11 -0500 | [diff] [blame] | 1158 | create index ACT_IDX_HI_OP_LOG_TASK on ACT_HI_OP_LOG(TASK_ID_); |
| 1159 | create index ACT_IDX_HI_OP_LOG_RM_TIME on ACT_HI_OP_LOG(REMOVAL_TIME_); |
| 1160 | create index ACT_IDX_HI_OP_LOG_TIMESTAMP on ACT_HI_OP_LOG(TIMESTAMP_); |
| 1161 | create index ACT_IDX_HI_OP_LOG_USER_ID on ACT_HI_OP_LOG(USER_ID_); |
| 1162 | create index ACT_IDX_HI_OP_LOG_OP_TYPE on ACT_HI_OP_LOG(OPERATION_TYPE_); |
| 1163 | create index ACT_IDX_HI_OP_LOG_ENTITY_TYPE on ACT_HI_OP_LOG(ENTITY_TYPE_); |
Benjamin, Max (mb388a) | 5a6a6de | 2018-07-30 15:56:09 -0400 | [diff] [blame] | 1164 | |
| 1165 | create index ACT_IDX_HI_COMMENT_TASK on ACT_HI_COMMENT(TASK_ID_); |
Benjamin, Max (mb388a) | d5968f5 | 2021-02-05 20:34:11 -0500 | [diff] [blame] | 1166 | create index ACT_IDX_HI_COMMENT_ROOT_PI on ACT_HI_COMMENT(ROOT_PROC_INST_ID_); |
Benjamin, Max (mb388a) | 5a6a6de | 2018-07-30 15:56:09 -0400 | [diff] [blame] | 1167 | create index ACT_IDX_HI_COMMENT_PROCINST on ACT_HI_COMMENT(PROC_INST_ID_); |
Benjamin, Max (mb388a) | d5968f5 | 2021-02-05 20:34:11 -0500 | [diff] [blame] | 1168 | create index ACT_IDX_HI_COMMENT_RM_TIME on ACT_HI_COMMENT(REMOVAL_TIME_); |
Benjamin, Max (mb388a) | 5a6a6de | 2018-07-30 15:56:09 -0400 | [diff] [blame] | 1169 | |
| 1170 | create index ACT_IDX_HI_ATTACHMENT_CONTENT on ACT_HI_ATTACHMENT(CONTENT_ID_); |
Benjamin, Max (mb388a) | d5968f5 | 2021-02-05 20:34:11 -0500 | [diff] [blame] | 1171 | create index ACT_IDX_HI_ATTACHMENT_ROOT_PI on ACT_HI_ATTACHMENT(ROOT_PROC_INST_ID_); |
Benjamin, Max (mb388a) | 5a6a6de | 2018-07-30 15:56:09 -0400 | [diff] [blame] | 1172 | create index ACT_IDX_HI_ATTACHMENT_PROCINST on ACT_HI_ATTACHMENT(PROC_INST_ID_); |
| 1173 | create index ACT_IDX_HI_ATTACHMENT_TASK on ACT_HI_ATTACHMENT(TASK_ID_); |
Benjamin, Max (mb388a) | d5968f5 | 2021-02-05 20:34:11 -0500 | [diff] [blame] | 1174 | create 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) | 5a6a6de | 2018-07-30 15:56:09 -0400 | [diff] [blame] | 1192 | create 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 | |
| 1209 | create 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 | |
| 1229 | create index ACT_IDX_HI_CAS_I_CLOSE on ACT_HI_CASEINST(CLOSE_TIME_); |
| 1230 | create index ACT_IDX_HI_CAS_I_BUSKEY on ACT_HI_CASEINST(BUSINESS_KEY_); |
| 1231 | create index ACT_IDX_HI_CAS_I_TENANT_ID on ACT_HI_CASEINST(TENANT_ID_); |
| 1232 | create index ACT_IDX_HI_CAS_A_I_CREATE on ACT_HI_CASEACTINST(CREATE_TIME_); |
| 1233 | create index ACT_IDX_HI_CAS_A_I_END on ACT_HI_CASEACTINST(END_TIME_); |
| 1234 | create index ACT_IDX_HI_CAS_A_I_COMP on ACT_HI_CASEACTINST(CASE_ACT_ID_, END_TIME_, ID_); |
| 1235 | create index ACT_IDX_HI_CAS_A_I_CASEINST on ACT_HI_CASEACTINST(CASE_INST_ID_, CASE_ACT_ID_); |
| 1236 | create index ACT_IDX_HI_CAS_A_I_TENANT_ID on ACT_HI_CASEACTINST(TENANT_ID_); |
Benjamin, Max (mb388a) | d5968f5 | 2021-02-05 20:34:11 -0500 | [diff] [blame] | 1237 | -- |
| 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) | 5a6a6de | 2018-07-30 15:56:09 -0400 | [diff] [blame] | 1254 | -- create history decision instance table -- |
| 1255 | create 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) | d5968f5 | 2021-02-05 20:34:11 -0500 | [diff] [blame] | 1269 | REMOVAL_TIME_ datetime(3), |
Benjamin, Max (mb388a) | 5a6a6de | 2018-07-30 15:56:09 -0400 | [diff] [blame] | 1270 | COLLECT_VALUE_ double, |
| 1271 | USER_ID_ varchar(255), |
| 1272 | ROOT_DEC_INST_ID_ varchar(64), |
Benjamin, Max (mb388a) | d5968f5 | 2021-02-05 20:34:11 -0500 | [diff] [blame] | 1273 | ROOT_PROC_INST_ID_ varchar(64), |
Benjamin, Max (mb388a) | 5a6a6de | 2018-07-30 15:56:09 -0400 | [diff] [blame] | 1274 | 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 -- |
| 1281 | create 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) | d5968f5 | 2021-02-05 20:34:11 -0500 | [diff] [blame] | 1290 | TEXT_ varchar(4000), |
| 1291 | TEXT2_ varchar(4000), |
Benjamin, Max (mb388a) | 5a6a6de | 2018-07-30 15:56:09 -0400 | [diff] [blame] | 1292 | TENANT_ID_ varchar(64), |
Benjamin, Max (mb388a) | d5968f5 | 2021-02-05 20:34:11 -0500 | [diff] [blame] | 1293 | CREATE_TIME_ datetime(3), |
| 1294 | ROOT_PROC_INST_ID_ varchar(64), |
| 1295 | REMOVAL_TIME_ datetime(3), |
Benjamin, Max (mb388a) | 5a6a6de | 2018-07-30 15:56:09 -0400 | [diff] [blame] | 1296 | primary key (ID_) |
| 1297 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE utf8_bin; |
| 1298 | |
| 1299 | -- create history decision output table -- |
| 1300 | create 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) | d5968f5 | 2021-02-05 20:34:11 -0500 | [diff] [blame] | 1312 | TEXT_ varchar(4000), |
| 1313 | TEXT2_ varchar(4000), |
Benjamin, Max (mb388a) | 5a6a6de | 2018-07-30 15:56:09 -0400 | [diff] [blame] | 1314 | TENANT_ID_ varchar(64), |
Benjamin, Max (mb388a) | d5968f5 | 2021-02-05 20:34:11 -0500 | [diff] [blame] | 1315 | CREATE_TIME_ datetime(3), |
| 1316 | ROOT_PROC_INST_ID_ varchar(64), |
| 1317 | REMOVAL_TIME_ datetime(3), |
Benjamin, Max (mb388a) | 5a6a6de | 2018-07-30 15:56:09 -0400 | [diff] [blame] | 1318 | primary key (ID_) |
| 1319 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE utf8_bin; |
| 1320 | |
| 1321 | |
| 1322 | create index ACT_IDX_HI_DEC_INST_ID on ACT_HI_DECINST(DEC_DEF_ID_); |
| 1323 | create index ACT_IDX_HI_DEC_INST_KEY on ACT_HI_DECINST(DEC_DEF_KEY_); |
| 1324 | create index ACT_IDX_HI_DEC_INST_PI on ACT_HI_DECINST(PROC_INST_ID_); |
| 1325 | create index ACT_IDX_HI_DEC_INST_CI on ACT_HI_DECINST(CASE_INST_ID_); |
| 1326 | create index ACT_IDX_HI_DEC_INST_ACT on ACT_HI_DECINST(ACT_ID_); |
| 1327 | create index ACT_IDX_HI_DEC_INST_ACT_INST on ACT_HI_DECINST(ACT_INST_ID_); |
| 1328 | create index ACT_IDX_HI_DEC_INST_TIME on ACT_HI_DECINST(EVAL_TIME_); |
| 1329 | create index ACT_IDX_HI_DEC_INST_TENANT_ID on ACT_HI_DECINST(TENANT_ID_); |
| 1330 | create index ACT_IDX_HI_DEC_INST_ROOT_ID on ACT_HI_DECINST(ROOT_DEC_INST_ID_); |
| 1331 | create index ACT_IDX_HI_DEC_INST_REQ_ID on ACT_HI_DECINST(DEC_REQ_ID_); |
| 1332 | create index ACT_IDX_HI_DEC_INST_REQ_KEY on ACT_HI_DECINST(DEC_REQ_KEY_); |
Benjamin, Max (mb388a) | d5968f5 | 2021-02-05 20:34:11 -0500 | [diff] [blame] | 1333 | create index ACT_IDX_HI_DEC_INST_ROOT_PI on ACT_HI_DECINST(ROOT_PROC_INST_ID_); |
| 1334 | create index ACT_IDX_HI_DEC_INST_RM_TIME on ACT_HI_DECINST(REMOVAL_TIME_); |
Benjamin, Max (mb388a) | 5a6a6de | 2018-07-30 15:56:09 -0400 | [diff] [blame] | 1335 | |
| 1336 | |
| 1337 | create index ACT_IDX_HI_DEC_IN_INST on ACT_HI_DEC_IN(DEC_INST_ID_); |
| 1338 | create index ACT_IDX_HI_DEC_IN_CLAUSE on ACT_HI_DEC_IN(DEC_INST_ID_, CLAUSE_ID_); |
Benjamin, Max (mb388a) | d5968f5 | 2021-02-05 20:34:11 -0500 | [diff] [blame] | 1339 | create index ACT_IDX_HI_DEC_IN_ROOT_PI on ACT_HI_DEC_IN(ROOT_PROC_INST_ID_); |
| 1340 | create index ACT_IDX_HI_DEC_IN_RM_TIME on ACT_HI_DEC_IN(REMOVAL_TIME_); |
Benjamin, Max (mb388a) | 5a6a6de | 2018-07-30 15:56:09 -0400 | [diff] [blame] | 1341 | |
| 1342 | create index ACT_IDX_HI_DEC_OUT_INST on ACT_HI_DEC_OUT(DEC_INST_ID_); |
| 1343 | create index ACT_IDX_HI_DEC_OUT_RULE on ACT_HI_DEC_OUT(RULE_ORDER_, CLAUSE_ID_); |
Benjamin, Max (mb388a) | d5968f5 | 2021-02-05 20:34:11 -0500 | [diff] [blame] | 1344 | create index ACT_IDX_HI_DEC_OUT_ROOT_PI on ACT_HI_DEC_OUT(ROOT_PROC_INST_ID_); |
| 1345 | create index ACT_IDX_HI_DEC_OUT_RM_TIME on ACT_HI_DEC_OUT(REMOVAL_TIME_); |