提交 | 用户 | 时间
|
0fbd01
|
1 |
CREATE database if NOT EXISTS `iailab_expert_master` default character set utf8mb4 collate utf8mb4_general_ci; |
潘 |
2 |
USE `iailab_expert_master`; |
|
3 |
|
|
4 |
-- 定时任务 |
|
5 |
CREATE TABLE schedule_job |
|
6 |
( |
|
7 |
id bigint NOT NULL COMMENT 'id', |
|
8 |
bean_name varchar(200) DEFAULT NULL COMMENT 'spring bean名称', |
|
9 |
params varchar(2000) DEFAULT NULL COMMENT '参数', |
|
10 |
cron_expression varchar(100) DEFAULT NULL COMMENT 'cron表达式', |
|
11 |
status tinyint unsigned COMMENT '任务状态 0:暂停 1:正常', |
|
12 |
remark varchar(255) DEFAULT NULL COMMENT '备注', |
|
13 |
creator bigint COMMENT '创建者', |
|
14 |
create_date datetime COMMENT '创建时间', |
|
15 |
updater bigint COMMENT '更新者', |
|
16 |
update_date datetime COMMENT '更新时间', |
|
17 |
`tenant_id` bigint NOT NULL DEFAULT '0' COMMENT '租户编号', |
|
18 |
PRIMARY KEY (id), |
|
19 |
key idx_create_date (create_date) |
|
20 |
) ENGINE = InnoDB |
|
21 |
DEFAULT CHARSET = utf8mb4 COMMENT ='定时任务'; |
|
22 |
|
|
23 |
-- 定时任务日志 |
|
24 |
CREATE TABLE schedule_job_log |
|
25 |
( |
|
26 |
id bigint NOT NULL COMMENT 'id', |
|
27 |
job_id bigint NOT NULL COMMENT '任务id', |
|
28 |
bean_name varchar(200) DEFAULT NULL COMMENT 'spring bean名称', |
|
29 |
params varchar(2000) DEFAULT NULL COMMENT '参数', |
|
30 |
status tinyint unsigned NOT NULL COMMENT '任务状态 0:失败 1:成功', |
|
31 |
error varchar(2000) DEFAULT NULL COMMENT '失败信息', |
|
32 |
times int NOT NULL COMMENT '耗时(单位:毫秒)', |
|
33 |
create_date datetime COMMENT '创建时间', |
|
34 |
`tenant_id` bigint NOT NULL DEFAULT '0' COMMENT '租户编号', |
|
35 |
PRIMARY KEY (id), |
|
36 |
key idx_job_id (job_id), |
|
37 |
key idx_create_date (create_date) |
|
38 |
) ENGINE = InnoDB |
|
39 |
DEFAULT CHARSET = utf8mb4 COMMENT ='定时任务日志'; |
|
40 |
|
|
41 |
-- quartz自带表结构 |
|
42 |
CREATE TABLE QRTZ_JOB_DETAILS |
|
43 |
( |
|
44 |
SCHED_NAME VARCHAR(120) NOT NULL, |
|
45 |
JOB_NAME VARCHAR(200) NOT NULL, |
|
46 |
JOB_GROUP VARCHAR(200) NOT NULL, |
|
47 |
DESCRIPTION VARCHAR(250) NULL, |
|
48 |
JOB_CLASS_NAME VARCHAR(250) NOT NULL, |
|
49 |
IS_DURABLE VARCHAR(1) NOT NULL, |
|
50 |
IS_NONCONCURRENT VARCHAR(1) NOT NULL, |
|
51 |
IS_UPDATE_DATA VARCHAR(1) NOT NULL, |
|
52 |
REQUESTS_RECOVERY VARCHAR(1) NOT NULL, |
|
53 |
JOB_DATA BLOB NULL, |
|
54 |
PRIMARY KEY (SCHED_NAME, JOB_NAME, JOB_GROUP) |
|
55 |
) |
|
56 |
ENGINE = InnoDB |
|
57 |
DEFAULT CHARSET = utf8; |
|
58 |
|
|
59 |
CREATE TABLE QRTZ_TRIGGERS |
|
60 |
( |
|
61 |
SCHED_NAME VARCHAR(120) NOT NULL, |
|
62 |
TRIGGER_NAME VARCHAR(200) NOT NULL, |
|
63 |
TRIGGER_GROUP VARCHAR(200) NOT NULL, |
|
64 |
JOB_NAME VARCHAR(200) NOT NULL, |
|
65 |
JOB_GROUP VARCHAR(200) NOT NULL, |
|
66 |
DESCRIPTION VARCHAR(250) NULL, |
|
67 |
NEXT_FIRE_TIME BIGINT(13) NULL, |
|
68 |
PREV_FIRE_TIME BIGINT(13) NULL, |
|
69 |
PRIORITY INTEGER NULL, |
|
70 |
TRIGGER_STATE VARCHAR(16) NOT NULL, |
|
71 |
TRIGGER_TYPE VARCHAR(8) NOT NULL, |
|
72 |
START_TIME BIGINT(13) NOT NULL, |
|
73 |
END_TIME BIGINT(13) NULL, |
|
74 |
CALENDAR_NAME VARCHAR(200) NULL, |
|
75 |
MISFIRE_INSTR SMALLINT(2) NULL, |
|
76 |
JOB_DATA BLOB NULL, |
|
77 |
PRIMARY KEY (SCHED_NAME, TRIGGER_NAME, TRIGGER_GROUP), |
|
78 |
FOREIGN KEY (SCHED_NAME, JOB_NAME, JOB_GROUP) |
|
79 |
REFERENCES QRTZ_JOB_DETAILS (SCHED_NAME, JOB_NAME, JOB_GROUP) |
|
80 |
) |
|
81 |
ENGINE = InnoDB |
|
82 |
DEFAULT CHARSET = utf8; |
|
83 |
|
|
84 |
CREATE TABLE QRTZ_SIMPLE_TRIGGERS |
|
85 |
( |
|
86 |
SCHED_NAME VARCHAR(120) NOT NULL, |
|
87 |
TRIGGER_NAME VARCHAR(200) NOT NULL, |
|
88 |
TRIGGER_GROUP VARCHAR(200) NOT NULL, |
|
89 |
REPEAT_COUNT BIGINT(7) NOT NULL, |
|
90 |
REPEAT_INTERVAL BIGINT(12) NOT NULL, |
|
91 |
TIMES_TRIGGERED BIGINT(10) NOT NULL, |
|
92 |
PRIMARY KEY (SCHED_NAME, TRIGGER_NAME, TRIGGER_GROUP), |
|
93 |
FOREIGN KEY (SCHED_NAME, TRIGGER_NAME, TRIGGER_GROUP) |
|
94 |
REFERENCES QRTZ_TRIGGERS (SCHED_NAME, TRIGGER_NAME, TRIGGER_GROUP) |
|
95 |
) |
|
96 |
ENGINE = InnoDB |
|
97 |
DEFAULT CHARSET = utf8; |
|
98 |
|
|
99 |
CREATE TABLE QRTZ_CRON_TRIGGERS |
|
100 |
( |
|
101 |
SCHED_NAME VARCHAR(120) NOT NULL, |
|
102 |
TRIGGER_NAME VARCHAR(200) NOT NULL, |
|
103 |
TRIGGER_GROUP VARCHAR(200) NOT NULL, |
|
104 |
CRON_EXPRESSION VARCHAR(120) NOT NULL, |
|
105 |
TIME_ZONE_ID VARCHAR(80), |
|
106 |
PRIMARY KEY (SCHED_NAME, TRIGGER_NAME, TRIGGER_GROUP), |
|
107 |
FOREIGN KEY (SCHED_NAME, TRIGGER_NAME, TRIGGER_GROUP) |
|
108 |
REFERENCES QRTZ_TRIGGERS (SCHED_NAME, TRIGGER_NAME, TRIGGER_GROUP) |
|
109 |
) |
|
110 |
ENGINE = InnoDB |
|
111 |
DEFAULT CHARSET = utf8; |
|
112 |
|
|
113 |
CREATE TABLE QRTZ_SIMPROP_TRIGGERS |
|
114 |
( |
|
115 |
SCHED_NAME VARCHAR(120) NOT NULL, |
|
116 |
TRIGGER_NAME VARCHAR(200) NOT NULL, |
|
117 |
TRIGGER_GROUP VARCHAR(200) NOT NULL, |
|
118 |
STR_PROP_1 VARCHAR(512) NULL, |
|
119 |
STR_PROP_2 VARCHAR(512) NULL, |
|
120 |
STR_PROP_3 VARCHAR(512) NULL, |
|
121 |
INT_PROP_1 INT NULL, |
|
122 |
INT_PROP_2 INT NULL, |
|
123 |
LONG_PROP_1 BIGINT NULL, |
|
124 |
LONG_PROP_2 BIGINT NULL, |
|
125 |
DEC_PROP_1 NUMERIC(13, 4) NULL, |
|
126 |
DEC_PROP_2 NUMERIC(13, 4) NULL, |
|
127 |
BOOL_PROP_1 VARCHAR(1) NULL, |
|
128 |
BOOL_PROP_2 VARCHAR(1) NULL, |
|
129 |
PRIMARY KEY (SCHED_NAME, TRIGGER_NAME, TRIGGER_GROUP), |
|
130 |
FOREIGN KEY (SCHED_NAME, TRIGGER_NAME, TRIGGER_GROUP) |
|
131 |
REFERENCES QRTZ_TRIGGERS (SCHED_NAME, TRIGGER_NAME, TRIGGER_GROUP) |
|
132 |
) |
|
133 |
ENGINE = InnoDB |
|
134 |
DEFAULT CHARSET = utf8; |
|
135 |
|
|
136 |
CREATE TABLE QRTZ_BLOB_TRIGGERS |
|
137 |
( |
|
138 |
SCHED_NAME VARCHAR(120) NOT NULL, |
|
139 |
TRIGGER_NAME VARCHAR(200) NOT NULL, |
|
140 |
TRIGGER_GROUP VARCHAR(200) NOT NULL, |
|
141 |
BLOB_DATA BLOB NULL, |
|
142 |
PRIMARY KEY (SCHED_NAME, TRIGGER_NAME, TRIGGER_GROUP), |
|
143 |
INDEX (SCHED_NAME, TRIGGER_NAME, TRIGGER_GROUP), |
|
144 |
FOREIGN KEY (SCHED_NAME, TRIGGER_NAME, TRIGGER_GROUP) |
|
145 |
REFERENCES QRTZ_TRIGGERS (SCHED_NAME, TRIGGER_NAME, TRIGGER_GROUP) |
|
146 |
) |
|
147 |
ENGINE = InnoDB |
|
148 |
DEFAULT CHARSET = utf8; |
|
149 |
|
|
150 |
CREATE TABLE QRTZ_CALENDARS |
|
151 |
( |
|
152 |
SCHED_NAME VARCHAR(120) NOT NULL, |
|
153 |
CALENDAR_NAME VARCHAR(200) NOT NULL, |
|
154 |
CALENDAR BLOB NOT NULL, |
|
155 |
PRIMARY KEY (SCHED_NAME, CALENDAR_NAME) |
|
156 |
) |
|
157 |
ENGINE = InnoDB |
|
158 |
DEFAULT CHARSET = utf8; |
|
159 |
|
|
160 |
CREATE TABLE QRTZ_PAUSED_TRIGGER_GRPS |
|
161 |
( |
|
162 |
SCHED_NAME VARCHAR(120) NOT NULL, |
|
163 |
TRIGGER_GROUP VARCHAR(200) NOT NULL, |
|
164 |
PRIMARY KEY (SCHED_NAME, TRIGGER_GROUP) |
|
165 |
) |
|
166 |
ENGINE = InnoDB |
|
167 |
DEFAULT CHARSET = utf8; |
|
168 |
|
|
169 |
CREATE TABLE QRTZ_FIRED_TRIGGERS |
|
170 |
( |
|
171 |
SCHED_NAME VARCHAR(120) NOT NULL, |
|
172 |
ENTRY_ID VARCHAR(95) NOT NULL, |
|
173 |
TRIGGER_NAME VARCHAR(200) NOT NULL, |
|
174 |
TRIGGER_GROUP VARCHAR(200) NOT NULL, |
|
175 |
INSTANCE_NAME VARCHAR(200) NOT NULL, |
|
176 |
FIRED_TIME BIGINT(13) NOT NULL, |
|
177 |
SCHED_TIME BIGINT(13) NOT NULL, |
|
178 |
PRIORITY INTEGER NOT NULL, |
|
179 |
STATE VARCHAR(16) NOT NULL, |
|
180 |
JOB_NAME VARCHAR(200) NULL, |
|
181 |
JOB_GROUP VARCHAR(200) NULL, |
|
182 |
IS_NONCONCURRENT VARCHAR(1) NULL, |
|
183 |
REQUESTS_RECOVERY VARCHAR(1) NULL, |
|
184 |
PRIMARY KEY (SCHED_NAME, ENTRY_ID) |
|
185 |
) |
|
186 |
ENGINE = InnoDB |
|
187 |
DEFAULT CHARSET = utf8; |
|
188 |
|
|
189 |
CREATE TABLE QRTZ_SCHEDULER_STATE |
|
190 |
( |
|
191 |
SCHED_NAME VARCHAR(120) NOT NULL, |
|
192 |
INSTANCE_NAME VARCHAR(200) NOT NULL, |
|
193 |
LAST_CHECKIN_TIME BIGINT(13) NOT NULL, |
|
194 |
CHECKIN_INTERVAL BIGINT(13) NOT NULL, |
|
195 |
PRIMARY KEY (SCHED_NAME, INSTANCE_NAME) |
|
196 |
) |
|
197 |
ENGINE = InnoDB |
|
198 |
DEFAULT CHARSET = utf8; |
|
199 |
|
|
200 |
CREATE TABLE QRTZ_LOCKS |
|
201 |
( |
|
202 |
SCHED_NAME VARCHAR(120) NOT NULL, |
|
203 |
LOCK_NAME VARCHAR(40) NOT NULL, |
|
204 |
PRIMARY KEY (SCHED_NAME, LOCK_NAME) |
|
205 |
) |
|
206 |
ENGINE = InnoDB |
|
207 |
DEFAULT CHARSET = utf8; |
|
208 |
|
|
209 |
CREATE INDEX IDX_QRTZ_J_REQ_RECOVERY ON QRTZ_JOB_DETAILS (SCHED_NAME, REQUESTS_RECOVERY); |
|
210 |
CREATE INDEX IDX_QRTZ_J_GRP ON QRTZ_JOB_DETAILS (SCHED_NAME, JOB_GROUP); |
|
211 |
|
|
212 |
CREATE INDEX IDX_QRTZ_T_J ON QRTZ_TRIGGERS (SCHED_NAME, JOB_NAME, JOB_GROUP); |
|
213 |
CREATE INDEX IDX_QRTZ_T_JG ON QRTZ_TRIGGERS (SCHED_NAME, JOB_GROUP); |
|
214 |
CREATE INDEX IDX_QRTZ_T_C ON QRTZ_TRIGGERS (SCHED_NAME, CALENDAR_NAME); |
|
215 |
CREATE INDEX IDX_QRTZ_T_G ON QRTZ_TRIGGERS (SCHED_NAME, TRIGGER_GROUP); |
|
216 |
CREATE INDEX IDX_QRTZ_T_STATE ON QRTZ_TRIGGERS (SCHED_NAME, TRIGGER_STATE); |
|
217 |
CREATE INDEX IDX_QRTZ_T_N_STATE ON QRTZ_TRIGGERS (SCHED_NAME, TRIGGER_NAME, TRIGGER_GROUP, TRIGGER_STATE); |
|
218 |
CREATE INDEX IDX_QRTZ_T_N_G_STATE ON QRTZ_TRIGGERS (SCHED_NAME, TRIGGER_GROUP, TRIGGER_STATE); |
|
219 |
CREATE INDEX IDX_QRTZ_T_NEXT_FIRE_TIME ON QRTZ_TRIGGERS (SCHED_NAME, NEXT_FIRE_TIME); |
|
220 |
CREATE INDEX IDX_QRTZ_T_NFT_ST ON QRTZ_TRIGGERS (SCHED_NAME, TRIGGER_STATE, NEXT_FIRE_TIME); |
|
221 |
CREATE INDEX IDX_QRTZ_T_NFT_MISFIRE ON QRTZ_TRIGGERS (SCHED_NAME, MISFIRE_INSTR, NEXT_FIRE_TIME); |
|
222 |
CREATE INDEX IDX_QRTZ_T_NFT_ST_MISFIRE ON QRTZ_TRIGGERS (SCHED_NAME, MISFIRE_INSTR, NEXT_FIRE_TIME, TRIGGER_STATE); |
|
223 |
CREATE INDEX IDX_QRTZ_T_NFT_ST_MISFIRE_GRP ON QRTZ_TRIGGERS (SCHED_NAME, MISFIRE_INSTR, NEXT_FIRE_TIME, TRIGGER_GROUP, |
|
224 |
TRIGGER_STATE); |
|
225 |
|
|
226 |
CREATE INDEX IDX_QRTZ_FT_TRIG_INST_NAME ON QRTZ_FIRED_TRIGGERS (SCHED_NAME, INSTANCE_NAME); |
|
227 |
CREATE INDEX IDX_QRTZ_FT_INST_JOB_REQ_RCVRY ON QRTZ_FIRED_TRIGGERS (SCHED_NAME, INSTANCE_NAME, REQUESTS_RECOVERY); |
|
228 |
CREATE INDEX IDX_QRTZ_FT_J_G ON QRTZ_FIRED_TRIGGERS (SCHED_NAME, JOB_NAME, JOB_GROUP); |
|
229 |
CREATE INDEX IDX_QRTZ_FT_JG ON QRTZ_FIRED_TRIGGERS (SCHED_NAME, JOB_GROUP); |
|
230 |
CREATE INDEX IDX_QRTZ_FT_T_G ON QRTZ_FIRED_TRIGGERS (SCHED_NAME, TRIGGER_NAME, TRIGGER_GROUP); |
|
231 |
CREATE INDEX IDX_QRTZ_FT_TG ON QRTZ_FIRED_TRIGGERS (SCHED_NAME, TRIGGER_GROUP); |