forked from infowangxin/springmvc
-
Notifications
You must be signed in to change notification settings - Fork 0
/
activiti.mysql.create.engine.sql
300 lines (265 loc) · 8.99 KB
/
activiti.mysql.create.engine.sql
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
create table ACT_GE_PROPERTY (
NAME_ varchar(64),
VALUE_ varchar(300),
REV_ integer,
primary key (NAME_)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE utf8_bin;
insert into ACT_GE_PROPERTY
values ('schema.version', '5.18.0.0', 1);
insert into ACT_GE_PROPERTY
values ('schema.history', 'create(5.18.0.0)', 1);
insert into ACT_GE_PROPERTY
values ('next.dbid', '1', 1);
create table ACT_GE_BYTEARRAY (
ID_ varchar(64),
REV_ integer,
NAME_ varchar(255),
DEPLOYMENT_ID_ varchar(64),
BYTES_ LONGBLOB,
GENERATED_ TINYINT,
primary key (ID_)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE utf8_bin;
create table ACT_RE_DEPLOYMENT (
ID_ varchar(64),
NAME_ varchar(255),
CATEGORY_ varchar(255),
TENANT_ID_ varchar(255) default '',
DEPLOY_TIME_ timestamp(3),
primary key (ID_)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE utf8_bin;
create table ACT_RE_MODEL (
ID_ varchar(64) not null,
REV_ integer,
NAME_ varchar(255),
KEY_ varchar(255),
CATEGORY_ varchar(255),
CREATE_TIME_ timestamp(3) null,
LAST_UPDATE_TIME_ timestamp(3) null,
VERSION_ integer,
META_INFO_ varchar(4000),
DEPLOYMENT_ID_ varchar(64),
EDITOR_SOURCE_VALUE_ID_ varchar(64),
EDITOR_SOURCE_EXTRA_VALUE_ID_ varchar(64),
TENANT_ID_ varchar(255) default '',
primary key (ID_)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE utf8_bin;
create table ACT_RU_EXECUTION (
ID_ varchar(64),
REV_ integer,
PROC_INST_ID_ varchar(64),
BUSINESS_KEY_ varchar(255),
PARENT_ID_ varchar(64),
PROC_DEF_ID_ varchar(64),
SUPER_EXEC_ varchar(64),
ACT_ID_ varchar(255),
IS_ACTIVE_ TINYINT,
IS_CONCURRENT_ TINYINT,
IS_SCOPE_ TINYINT,
IS_EVENT_SCOPE_ TINYINT,
SUSPENSION_STATE_ integer,
CACHED_ENT_STATE_ integer,
TENANT_ID_ varchar(255) default '',
NAME_ varchar(255),
LOCK_TIME_ timestamp(3) NULL,
primary key (ID_)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE utf8_bin;
create table ACT_RU_JOB (
ID_ varchar(64) NOT NULL,
REV_ integer,
TYPE_ varchar(255) NOT NULL,
LOCK_EXP_TIME_ timestamp(3) NULL,
LOCK_OWNER_ varchar(255),
EXCLUSIVE_ boolean,
EXECUTION_ID_ varchar(64),
PROCESS_INSTANCE_ID_ varchar(64),
PROC_DEF_ID_ varchar(64),
RETRIES_ integer,
EXCEPTION_STACK_ID_ varchar(64),
EXCEPTION_MSG_ varchar(4000),
DUEDATE_ timestamp(3) NULL,
REPEAT_ varchar(255),
HANDLER_TYPE_ varchar(255),
HANDLER_CFG_ varchar(4000),
TENANT_ID_ varchar(255) default '',
primary key (ID_)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE utf8_bin;
create table ACT_RE_PROCDEF (
ID_ varchar(64) not null,
REV_ integer,
CATEGORY_ varchar(255),
NAME_ varchar(255),
KEY_ varchar(255) not null,
VERSION_ integer not null,
DEPLOYMENT_ID_ varchar(64),
RESOURCE_NAME_ varchar(4000),
DGRM_RESOURCE_NAME_ varchar(4000),
DESCRIPTION_ varchar(4000),
HAS_START_FORM_KEY_ TINYINT,
HAS_GRAPHICAL_NOTATION_ TINYINT,
SUSPENSION_STATE_ integer,
TENANT_ID_ varchar(255) default '',
primary key (ID_)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE utf8_bin;
create table ACT_RU_TASK (
ID_ varchar(64),
REV_ integer,
EXECUTION_ID_ varchar(64),
PROC_INST_ID_ varchar(64),
PROC_DEF_ID_ varchar(64),
NAME_ varchar(255),
PARENT_TASK_ID_ varchar(64),
DESCRIPTION_ varchar(4000),
TASK_DEF_KEY_ varchar(255),
OWNER_ varchar(255),
ASSIGNEE_ varchar(255),
DELEGATION_ varchar(64),
PRIORITY_ integer,
CREATE_TIME_ timestamp(3),
DUE_DATE_ datetime(3),
CATEGORY_ varchar(255),
SUSPENSION_STATE_ integer,
TENANT_ID_ varchar(255) default '',
FORM_KEY_ varchar(255),
primary key (ID_)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE utf8_bin;
create table ACT_RU_IDENTITYLINK (
ID_ varchar(64),
REV_ integer,
GROUP_ID_ varchar(255),
TYPE_ varchar(255),
USER_ID_ varchar(255),
TASK_ID_ varchar(64),
PROC_INST_ID_ varchar(64),
PROC_DEF_ID_ varchar(64),
primary key (ID_)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE utf8_bin;
create table ACT_RU_VARIABLE (
ID_ varchar(64) not null,
REV_ integer,
TYPE_ varchar(255) not null,
NAME_ varchar(255) not null,
EXECUTION_ID_ varchar(64),
PROC_INST_ID_ varchar(64),
TASK_ID_ varchar(64),
BYTEARRAY_ID_ varchar(64),
DOUBLE_ double,
LONG_ bigint,
TEXT_ varchar(4000),
TEXT2_ varchar(4000),
primary key (ID_)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE utf8_bin;
create table ACT_RU_EVENT_SUBSCR (
ID_ varchar(64) not null,
REV_ integer,
EVENT_TYPE_ varchar(255) not null,
EVENT_NAME_ varchar(255),
EXECUTION_ID_ varchar(64),
PROC_INST_ID_ varchar(64),
ACTIVITY_ID_ varchar(64),
CONFIGURATION_ varchar(255),
CREATED_ timestamp(3) not null DEFAULT CURRENT_TIMESTAMP(3),
PROC_DEF_ID_ varchar(64),
TENANT_ID_ varchar(255) default '',
primary key (ID_)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE utf8_bin;
create table ACT_EVT_LOG (
LOG_NR_ bigint auto_increment,
TYPE_ varchar(64),
PROC_DEF_ID_ varchar(64),
PROC_INST_ID_ varchar(64),
EXECUTION_ID_ varchar(64),
TASK_ID_ varchar(64),
TIME_STAMP_ timestamp(3) not null,
USER_ID_ varchar(255),
DATA_ LONGBLOB,
LOCK_OWNER_ varchar(255),
LOCK_TIME_ timestamp(3) null,
IS_PROCESSED_ tinyint default 0,
primary key (LOG_NR_)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE utf8_bin;
create index ACT_IDX_EXEC_BUSKEY on ACT_RU_EXECUTION(BUSINESS_KEY_);
create index ACT_IDX_TASK_CREATE on ACT_RU_TASK(CREATE_TIME_);
create index ACT_IDX_IDENT_LNK_USER on ACT_RU_IDENTITYLINK(USER_ID_);
create index ACT_IDX_IDENT_LNK_GROUP on ACT_RU_IDENTITYLINK(GROUP_ID_);
create index ACT_IDX_EVENT_SUBSCR_CONFIG_ on ACT_RU_EVENT_SUBSCR(CONFIGURATION_);
create index ACT_IDX_VARIABLE_TASK_ID on ACT_RU_VARIABLE(TASK_ID_);
create index ACT_IDX_ATHRZ_PROCEDEF on ACT_RU_IDENTITYLINK(PROC_DEF_ID_);
alter table ACT_GE_BYTEARRAY
add constraint ACT_FK_BYTEARR_DEPL
foreign key (DEPLOYMENT_ID_)
references ACT_RE_DEPLOYMENT (ID_);
alter table ACT_RE_PROCDEF
add constraint ACT_UNIQ_PROCDEF
unique (KEY_,VERSION_, TENANT_ID_);
alter table ACT_RU_EXECUTION
add constraint ACT_FK_EXE_PROCINST
foreign key (PROC_INST_ID_)
references ACT_RU_EXECUTION (ID_) on delete cascade on update cascade;
alter table ACT_RU_EXECUTION
add constraint ACT_FK_EXE_PARENT
foreign key (PARENT_ID_)
references ACT_RU_EXECUTION (ID_);
alter table ACT_RU_EXECUTION
add constraint ACT_FK_EXE_SUPER
foreign key (SUPER_EXEC_)
references ACT_RU_EXECUTION (ID_);
alter table ACT_RU_EXECUTION
add constraint ACT_FK_EXE_PROCDEF
foreign key (PROC_DEF_ID_)
references ACT_RE_PROCDEF (ID_);
alter table ACT_RU_IDENTITYLINK
add constraint ACT_FK_TSKASS_TASK
foreign key (TASK_ID_)
references ACT_RU_TASK (ID_);
alter table ACT_RU_IDENTITYLINK
add constraint ACT_FK_ATHRZ_PROCEDEF
foreign key (PROC_DEF_ID_)
references ACT_RE_PROCDEF(ID_);
alter table ACT_RU_IDENTITYLINK
add constraint ACT_FK_IDL_PROCINST
foreign key (PROC_INST_ID_)
references ACT_RU_EXECUTION (ID_);
alter table ACT_RU_TASK
add constraint ACT_FK_TASK_EXE
foreign key (EXECUTION_ID_)
references ACT_RU_EXECUTION (ID_);
alter table ACT_RU_TASK
add constraint ACT_FK_TASK_PROCINST
foreign key (PROC_INST_ID_)
references ACT_RU_EXECUTION (ID_);
alter table ACT_RU_TASK
add constraint ACT_FK_TASK_PROCDEF
foreign key (PROC_DEF_ID_)
references ACT_RE_PROCDEF (ID_);
alter table ACT_RU_VARIABLE
add constraint ACT_FK_VAR_EXE
foreign key (EXECUTION_ID_)
references ACT_RU_EXECUTION (ID_);
alter table ACT_RU_VARIABLE
add constraint ACT_FK_VAR_PROCINST
foreign key (PROC_INST_ID_)
references ACT_RU_EXECUTION(ID_);
alter table ACT_RU_VARIABLE
add constraint ACT_FK_VAR_BYTEARRAY
foreign key (BYTEARRAY_ID_)
references ACT_GE_BYTEARRAY (ID_);
alter table ACT_RU_JOB
add constraint ACT_FK_JOB_EXCEPTION
foreign key (EXCEPTION_STACK_ID_)
references ACT_GE_BYTEARRAY (ID_);
alter table ACT_RU_EVENT_SUBSCR
add constraint ACT_FK_EVENT_EXEC
foreign key (EXECUTION_ID_)
references ACT_RU_EXECUTION(ID_);
alter table ACT_RE_MODEL
add constraint ACT_FK_MODEL_SOURCE
foreign key (EDITOR_SOURCE_VALUE_ID_)
references ACT_GE_BYTEARRAY (ID_);
alter table ACT_RE_MODEL
add constraint ACT_FK_MODEL_SOURCE_EXTRA
foreign key (EDITOR_SOURCE_EXTRA_VALUE_ID_)
references ACT_GE_BYTEARRAY (ID_);
alter table ACT_RE_MODEL
add constraint ACT_FK_MODEL_DEPLOYMENT
foreign key (DEPLOYMENT_ID_)
references ACT_RE_DEPLOYMENT (ID_);