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