提交 | 用户 | 时间
|
e7c126
|
1 |
CREATE TABLE IF NOT EXISTS "system_dept" ( |
H |
2 |
"id" bigint NOT NULL GENERATED BY DEFAULT AS IDENTITY, |
|
3 |
"name" varchar(30) NOT NULL DEFAULT '', |
|
4 |
"parent_id" bigint NOT NULL DEFAULT '0', |
|
5 |
"sort" int NOT NULL DEFAULT '0', |
|
6 |
"leader_user_id" bigint DEFAULT NULL, |
|
7 |
"phone" varchar(11) DEFAULT NULL, |
|
8 |
"email" varchar(50) DEFAULT NULL, |
|
9 |
"status" tinyint NOT NULL, |
|
10 |
"creator" varchar(64) DEFAULT '', |
|
11 |
"create_time" timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, |
|
12 |
"updater" varchar(64) DEFAULT '', |
|
13 |
"update_time" timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, |
|
14 |
"deleted" bit NOT NULL DEFAULT FALSE, |
|
15 |
"tenant_id" bigint not null default '0', |
|
16 |
PRIMARY KEY ("id") |
|
17 |
) COMMENT '部门表'; |
|
18 |
|
|
19 |
CREATE TABLE IF NOT EXISTS "system_dict_data" ( |
|
20 |
"id" bigint NOT NULL GENERATED BY DEFAULT AS IDENTITY, |
|
21 |
"sort" int NOT NULL DEFAULT '0', |
|
22 |
"label" varchar(100) NOT NULL DEFAULT '', |
|
23 |
"value" varchar(100) NOT NULL DEFAULT '', |
|
24 |
"dict_type" varchar(100) NOT NULL DEFAULT '', |
|
25 |
"status" tinyint NOT NULL DEFAULT '0', |
|
26 |
"color_type" varchar(100) NOT NULL DEFAULT '', |
|
27 |
"css_class" varchar(100) NOT NULL DEFAULT '', |
|
28 |
"remark" varchar(500) DEFAULT NULL, |
|
29 |
"creator" varchar(64) DEFAULT '', |
|
30 |
"create_time" timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, |
|
31 |
"updater" varchar(64) DEFAULT '', |
|
32 |
"update_time" timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, |
|
33 |
"deleted" bit NOT NULL DEFAULT FALSE, |
|
34 |
PRIMARY KEY ("id") |
|
35 |
) COMMENT '字典数据表'; |
|
36 |
|
|
37 |
CREATE TABLE IF NOT EXISTS "system_role" ( |
|
38 |
"id" bigint NOT NULL GENERATED BY DEFAULT AS IDENTITY, |
|
39 |
"name" varchar(30) NOT NULL, |
|
40 |
"code" varchar(100) NOT NULL, |
|
41 |
"sort" int NOT NULL, |
|
42 |
"data_scope" tinyint NOT NULL DEFAULT '1', |
|
43 |
"data_scope_dept_ids" varchar(500) NOT NULL DEFAULT '', |
|
44 |
"status" tinyint NOT NULL, |
|
45 |
"type" tinyint NOT NULL, |
|
46 |
"remark" varchar(500) DEFAULT NULL, |
|
47 |
"creator" varchar(64) DEFAULT '', |
|
48 |
"create_time" timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, |
|
49 |
"updater" varchar(64) DEFAULT '', |
|
50 |
"update_time" timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, |
|
51 |
"deleted" bit NOT NULL DEFAULT FALSE, |
|
52 |
"tenant_id" bigint not null default '0', |
|
53 |
PRIMARY KEY ("id") |
|
54 |
) COMMENT '角色信息表'; |
|
55 |
|
|
56 |
CREATE TABLE IF NOT EXISTS "system_role_menu" ( |
|
57 |
"id" bigint NOT NULL GENERATED BY DEFAULT AS IDENTITY, |
|
58 |
"role_id" bigint NOT NULL, |
|
59 |
"menu_id" bigint NOT NULL, |
|
60 |
"creator" varchar(64) DEFAULT '', |
|
61 |
"create_time" timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, |
|
62 |
"updater" varchar(64) DEFAULT '', |
|
63 |
"update_time" timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, |
|
64 |
"deleted" bit NOT NULL DEFAULT FALSE, |
|
65 |
"tenant_id" bigint not null default '0', |
|
66 |
PRIMARY KEY ("id") |
|
67 |
) COMMENT '角色和菜单关联表'; |
|
68 |
|
|
69 |
CREATE TABLE IF NOT EXISTS "system_menu" ( |
|
70 |
"id" bigint NOT NULL GENERATED BY DEFAULT AS IDENTITY, |
|
71 |
"name" varchar(50) NOT NULL, |
|
72 |
"permission" varchar(100) NOT NULL DEFAULT '', |
|
73 |
"type" tinyint NOT NULL, |
|
74 |
"sort" int NOT NULL DEFAULT '0', |
|
75 |
"parent_id" bigint NOT NULL DEFAULT '0', |
|
76 |
"path" varchar(200) DEFAULT '', |
|
77 |
"icon" varchar(100) DEFAULT '#', |
|
78 |
"component" varchar(255) DEFAULT NULL, |
|
79 |
"component_name" varchar(255) DEFAULT NULL, |
|
80 |
"status" tinyint NOT NULL DEFAULT '0', |
|
81 |
"visible" bit NOT NULL DEFAULT TRUE, |
|
82 |
"keep_alive" bit NOT NULL DEFAULT TRUE, |
|
83 |
"always_show" bit NOT NULL DEFAULT TRUE, |
|
84 |
"creator" varchar(64) DEFAULT '', |
|
85 |
"create_time" timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, |
|
86 |
"updater" varchar(64) DEFAULT '', |
|
87 |
"update_time" timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, |
|
88 |
"deleted" bit NOT NULL DEFAULT FALSE, |
|
89 |
PRIMARY KEY ("id") |
|
90 |
) COMMENT '菜单权限表'; |
|
91 |
|
|
92 |
CREATE TABLE IF NOT EXISTS "system_user_role" ( |
|
93 |
"id" bigint NOT NULL GENERATED BY DEFAULT AS IDENTITY, |
|
94 |
"user_id" bigint NOT NULL, |
|
95 |
"role_id" bigint NOT NULL, |
|
96 |
"creator" varchar(64) DEFAULT '', |
|
97 |
"create_time" timestamp DEFAULT NULL, |
|
98 |
"updater" varchar(64) DEFAULT '', |
|
99 |
"update_time" timestamp DEFAULT NULL, |
|
100 |
"deleted" bit DEFAULT FALSE, |
|
101 |
"tenant_id" bigint not null default '0', |
|
102 |
PRIMARY KEY ("id") |
|
103 |
) COMMENT '用户和角色关联表'; |
|
104 |
|
|
105 |
CREATE TABLE IF NOT EXISTS "system_dict_type" ( |
|
106 |
"id" bigint NOT NULL GENERATED BY DEFAULT AS IDENTITY, |
|
107 |
"name" varchar(100) NOT NULL DEFAULT '', |
|
108 |
"type" varchar(100) NOT NULL DEFAULT '', |
|
109 |
"status" tinyint NOT NULL DEFAULT '0', |
|
110 |
"remark" varchar(500) DEFAULT NULL, |
|
111 |
"creator" varchar(64) DEFAULT '', |
|
112 |
"create_time" timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, |
|
113 |
"updater" varchar(64) DEFAULT '', |
|
114 |
"update_time" timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, |
|
115 |
"deleted" bit NOT NULL DEFAULT FALSE, |
|
116 |
"deleted_time" timestamp NOT NULL, |
|
117 |
PRIMARY KEY ("id") |
|
118 |
) COMMENT '字典类型表'; |
|
119 |
|
|
120 |
CREATE TABLE IF NOT EXISTS `system_user_session` ( |
|
121 |
"id" bigint NOT NULL GENERATED BY DEFAULT AS IDENTITY, |
|
122 |
`token` varchar(32) NOT NULL, |
|
123 |
`user_id` bigint DEFAULT NULL, |
|
124 |
"user_type" tinyint NOT NULL, |
|
125 |
`username` varchar(50) NOT NULL DEFAULT '', |
|
126 |
`user_ip` varchar(50) DEFAULT NULL, |
|
127 |
`user_agent` varchar(512) DEFAULT NULL, |
|
128 |
`session_timeout` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, |
|
129 |
"creator" varchar(64) DEFAULT '', |
|
130 |
"create_time" timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, |
|
131 |
`updater` varchar(64) DEFAULT '' , |
|
132 |
"update_time" timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, |
|
133 |
"deleted" bit NOT NULL DEFAULT FALSE, |
|
134 |
"tenant_id" bigint not null default '0', |
|
135 |
PRIMARY KEY (`id`) |
|
136 |
) COMMENT '用户在线 Session'; |
|
137 |
|
|
138 |
CREATE TABLE IF NOT EXISTS "system_post" ( |
|
139 |
"id" bigint NOT NULL GENERATED BY DEFAULT AS IDENTITY, |
|
140 |
"code" varchar(64) NOT NULL, |
|
141 |
"name" varchar(50) NOT NULL, |
|
142 |
"sort" integer NOT NULL, |
|
143 |
"status" tinyint NOT NULL, |
|
144 |
"remark" varchar(500) DEFAULT NULL, |
|
145 |
"creator" varchar(64) DEFAULT '', |
|
146 |
"create_time" timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, |
|
147 |
"updater" varchar(64) DEFAULT '', |
|
148 |
"update_time" timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, |
|
149 |
"deleted" bit NOT NULL DEFAULT FALSE, |
|
150 |
"tenant_id" bigint not null default '0', |
|
151 |
PRIMARY KEY ("id") |
|
152 |
) COMMENT '岗位信息表'; |
|
153 |
|
|
154 |
CREATE TABLE IF NOT EXISTS `system_user_post`( |
|
155 |
"id" bigint NOT NULL GENERATED BY DEFAULT AS IDENTITY, |
|
156 |
"user_id" bigint DEFAULT NULL, |
|
157 |
"post_id" bigint DEFAULT NULL, |
|
158 |
"creator" varchar(64) DEFAULT '', |
|
159 |
"create_time" timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, |
|
160 |
"updater" varchar(64) DEFAULT '', |
|
161 |
"update_time" timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, |
|
162 |
"deleted" bit NOT NULL DEFAULT FALSE, |
|
163 |
"tenant_id" bigint not null default '0', |
|
164 |
PRIMARY KEY (`id`) |
|
165 |
) COMMENT ='用户岗位表'; |
|
166 |
|
|
167 |
CREATE TABLE IF NOT EXISTS "system_notice" ( |
|
168 |
"id" bigint NOT NULL GENERATED BY DEFAULT AS IDENTITY, |
|
169 |
"title" varchar(50) NOT NULL COMMENT '公告标题', |
|
170 |
"content" text NOT NULL COMMENT '公告内容', |
|
171 |
"type" tinyint NOT NULL COMMENT '公告类型(1通知 2公告)', |
|
172 |
"status" tinyint NOT NULL DEFAULT '0' COMMENT '公告状态(0正常 1关闭)', |
|
173 |
"creator" varchar(64) DEFAULT '' COMMENT '创建者', |
|
174 |
"create_time" datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', |
|
175 |
"updater" varchar(64) DEFAULT '' COMMENT '更新者', |
|
176 |
"update_time" datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间', |
|
177 |
"deleted" bit NOT NULL DEFAULT 0 COMMENT '是否删除', |
|
178 |
"tenant_id" bigint not null default '0', |
|
179 |
PRIMARY KEY("id") |
|
180 |
) COMMENT '通知公告表'; |
|
181 |
|
|
182 |
CREATE TABLE IF NOT EXISTS `system_login_log` ( |
|
183 |
`id` bigint(20) NOT NULL GENERATED BY DEFAULT AS IDENTITY, |
|
184 |
`log_type` bigint(4) NOT NULL, |
|
185 |
"user_id" bigint not null default '0', |
|
186 |
"user_type" tinyint NOT NULL, |
|
187 |
`trace_id` varchar(64) NOT NULL DEFAULT '', |
|
188 |
`username` varchar(50) NOT NULL DEFAULT '', |
|
189 |
`result` tinyint(4) NOT NULL, |
|
190 |
`user_ip` varchar(50) NOT NULL, |
|
191 |
`user_agent` varchar(512) NOT NULL, |
|
192 |
`creator` varchar(64) DEFAULT '', |
|
193 |
`create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP, |
|
194 |
`updater` varchar(64) DEFAULT '', |
|
195 |
`update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, |
|
196 |
`deleted` bit(1) NOT NULL DEFAULT '0', |
|
197 |
PRIMARY KEY (`id`) |
|
198 |
) COMMENT ='系统访问记录'; |
|
199 |
|
|
200 |
CREATE TABLE IF NOT EXISTS `system_operate_log` ( |
|
201 |
`id` bigint(20) NOT NULL GENERATED BY DEFAULT AS IDENTITY, |
|
202 |
`trace_id` varchar(64) NOT NULL DEFAULT '', |
|
203 |
`user_id` bigint(20) NOT NULL, |
|
204 |
"user_type" tinyint not null default '0', |
|
205 |
`type` varchar(50) NOT NULL, |
|
206 |
`sub_type` varchar(50) NOT NULL, |
|
207 |
`biz_id` bigint(20) NOT NULL, |
|
208 |
`action` varchar(2000) NOT NULL DEFAULT '', |
|
209 |
`extra` varchar(512) NOT NULL DEFAULT '', |
|
210 |
`request_method` varchar(16) DEFAULT '', |
|
211 |
`request_url` varchar(255) DEFAULT '', |
|
212 |
`user_ip` varchar(50) DEFAULT NULL, |
|
213 |
`user_agent` varchar(200) DEFAULT NULL, |
|
214 |
`creator` varchar(64) DEFAULT '', |
|
215 |
`create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP, |
|
216 |
`updater` varchar(64) DEFAULT '', |
|
217 |
`update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, |
|
218 |
`deleted` bit(1) NOT NULL DEFAULT '0', |
|
219 |
"tenant_id" bigint not null default '0', |
|
220 |
PRIMARY KEY (`id`) |
|
221 |
) COMMENT ='操作日志记录'; |
|
222 |
|
|
223 |
CREATE TABLE IF NOT EXISTS "system_users" ( |
|
224 |
"id" bigint not null GENERATED BY DEFAULT AS IDENTITY, |
|
225 |
"username" varchar(30) not null, |
|
226 |
"password" varchar(100) not null default '', |
|
227 |
"nickname" varchar(30) not null, |
|
228 |
"remark" varchar(500) default null, |
|
229 |
"dept_id" bigint default null, |
|
230 |
"post_ids" varchar(255) default null, |
|
231 |
"email" varchar(50) default '', |
|
232 |
"mobile" varchar(11) default '', |
|
233 |
"sex" tinyint default '0', |
|
234 |
"avatar" varchar(100) default '', |
|
235 |
"status" tinyint not null default '0', |
|
236 |
"login_ip" varchar(50) default '', |
|
237 |
"login_date" timestamp default null, |
|
238 |
"creator" varchar(64) default '', |
|
239 |
"create_time" timestamp not null default current_timestamp, |
|
240 |
"updater" varchar(64) default '', |
|
241 |
"update_time" timestamp not null default current_timestamp, |
|
242 |
"deleted" bit not null default false, |
|
243 |
"tenant_id" bigint not null default '0', |
|
244 |
primary key ("id") |
|
245 |
) comment '用户信息表'; |
|
246 |
|
|
247 |
CREATE TABLE IF NOT EXISTS "system_sms_channel" ( |
|
248 |
"id" bigint NOT NULL GENERATED BY DEFAULT AS IDENTITY, |
|
249 |
"signature" varchar(10) NOT NULL, |
|
250 |
"code" varchar(63) NOT NULL, |
|
251 |
"status" tinyint NOT NULL, |
|
252 |
"remark" varchar(255) DEFAULT NULL, |
|
253 |
"api_key" varchar(63) NOT NULL, |
|
254 |
"api_secret" varchar(63) DEFAULT NULL, |
|
255 |
"callback_url" varchar(255) DEFAULT NULL, |
|
256 |
"creator" varchar(64) DEFAULT '', |
|
257 |
"create_time" timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, |
|
258 |
"updater" varchar(64) DEFAULT '', |
|
259 |
"update_time" timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, |
|
260 |
"deleted" bit NOT NULL DEFAULT FALSE, |
|
261 |
PRIMARY KEY ("id") |
|
262 |
) COMMENT '短信渠道'; |
|
263 |
|
|
264 |
CREATE TABLE IF NOT EXISTS "system_sms_template" ( |
|
265 |
"id" bigint NOT NULL GENERATED BY DEFAULT AS IDENTITY, |
|
266 |
"type" tinyint NOT NULL, |
|
267 |
"status" tinyint NOT NULL, |
|
268 |
"code" varchar(63) NOT NULL, |
|
269 |
"name" varchar(63) NOT NULL, |
|
270 |
"content" varchar(255) NOT NULL, |
|
271 |
"params" varchar(255) NOT NULL, |
|
272 |
"remark" varchar(255) DEFAULT NULL, |
|
273 |
"api_template_id" varchar(63) NOT NULL, |
|
274 |
"channel_id" bigint NOT NULL, |
|
275 |
"channel_code" varchar(63) NOT NULL, |
|
276 |
"creator" varchar(64) DEFAULT '', |
|
277 |
"create_time" timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, |
|
278 |
"updater" varchar(64) DEFAULT '', |
|
279 |
"update_time" timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, |
|
280 |
"deleted" bit NOT NULL DEFAULT FALSE, |
|
281 |
PRIMARY KEY ("id") |
|
282 |
) COMMENT '短信模板'; |
|
283 |
|
|
284 |
CREATE TABLE IF NOT EXISTS "system_sms_log" ( |
|
285 |
"id" bigint NOT NULL GENERATED BY DEFAULT AS IDENTITY, |
|
286 |
"channel_id" bigint NOT NULL, |
|
287 |
"channel_code" varchar(63) NOT NULL, |
|
288 |
"template_id" bigint NOT NULL, |
|
289 |
"template_code" varchar(63) NOT NULL, |
|
290 |
"template_type" tinyint NOT NULL, |
|
291 |
"template_content" varchar(255) NOT NULL, |
|
292 |
"template_params" varchar(255) NOT NULL, |
|
293 |
"api_template_id" varchar(63) NOT NULL, |
|
294 |
"mobile" varchar(11) NOT NULL, |
|
295 |
"user_id" bigint DEFAULT '0', |
|
296 |
"user_type" tinyint DEFAULT '0', |
|
297 |
"send_status" tinyint NOT NULL DEFAULT '0', |
|
298 |
"send_time" timestamp DEFAULT NULL, |
|
299 |
"send_code" int DEFAULT NULL, |
|
300 |
"send_msg" varchar(255) DEFAULT NULL, |
|
301 |
"api_send_code" varchar(63) DEFAULT NULL, |
|
302 |
"api_send_msg" varchar(255) DEFAULT NULL, |
|
303 |
"api_request_id" varchar(255) DEFAULT NULL, |
|
304 |
"api_serial_no" varchar(255) DEFAULT NULL, |
|
305 |
"receive_status" tinyint NOT NULL DEFAULT '0', |
|
306 |
"receive_time" timestamp DEFAULT NULL, |
|
307 |
"api_receive_code" varchar(63) DEFAULT NULL, |
|
308 |
"api_receive_msg" varchar(255) DEFAULT NULL, |
|
309 |
"creator" varchar(64) DEFAULT '', |
|
310 |
"create_time" timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, |
|
311 |
"updater" varchar(64) DEFAULT '', |
|
312 |
"update_time" timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, |
|
313 |
"deleted" bit NOT NULL DEFAULT FALSE, |
|
314 |
PRIMARY KEY ("id") |
|
315 |
) COMMENT '短信日志'; |
|
316 |
|
|
317 |
CREATE TABLE IF NOT EXISTS "system_sms_code" ( |
|
318 |
"id" bigint NOT NULL GENERATED BY DEFAULT AS IDENTITY, |
|
319 |
"mobile" varchar(11) NOT NULL, |
|
320 |
"code" varchar(11) NOT NULL, |
|
321 |
"scene" bigint NOT NULL, |
|
322 |
"create_ip" varchar NOT NULL, |
|
323 |
"today_index" int NOT NULL, |
|
324 |
"used" bit NOT NULL DEFAULT FALSE, |
|
325 |
"used_time" timestamp DEFAULT NULL, |
|
326 |
"used_ip" varchar NULL, |
|
327 |
"creator" varchar(64) DEFAULT '', |
|
328 |
"create_time" timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, |
|
329 |
"updater" varchar(64) DEFAULT '', |
|
330 |
"update_time" timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, |
|
331 |
"deleted" bit NOT NULL DEFAULT FALSE, |
|
332 |
PRIMARY KEY ("id") |
|
333 |
) COMMENT '短信日志'; |
|
334 |
|
|
335 |
CREATE TABLE IF NOT EXISTS "system_social_client" ( |
|
336 |
"id" bigint NOT NULL GENERATED BY DEFAULT AS IDENTITY, |
|
337 |
"name" varchar(255) NOT NULL, |
|
338 |
"social_type" int NOT NULL, |
|
339 |
"user_type" int NOT NULL, |
|
340 |
"client_id" varchar(255) NOT NULL, |
|
341 |
"client_secret" varchar(255) NOT NULL, |
|
342 |
"agent_id" varchar(255) NOT NULL, |
|
343 |
"status" int NOT NULL, |
|
344 |
"creator" varchar(64) DEFAULT '', |
|
345 |
"create_time" datetime NOT NULL DEFAULT CURRENT_TIMESTAMP, |
|
346 |
"updater" varchar(64) DEFAULT '', |
|
347 |
"update_time" datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, |
|
348 |
"deleted" bit NOT NULL DEFAULT FALSE, |
|
349 |
"tenant_id" bigint not null default '0', |
|
350 |
PRIMARY KEY ("id") |
|
351 |
) COMMENT '社交客户端表'; |
|
352 |
|
|
353 |
CREATE TABLE IF NOT EXISTS "system_social_user" ( |
|
354 |
"id" bigint NOT NULL GENERATED BY DEFAULT AS IDENTITY, |
|
355 |
"type" tinyint NOT NULL, |
|
356 |
"openid" varchar(64) NOT NULL, |
|
357 |
"token" varchar(256) DEFAULT NULL, |
|
358 |
"raw_token_info" varchar(1024) NOT NULL, |
|
359 |
"nickname" varchar(32) NOT NULL, |
|
360 |
"avatar" varchar(255) DEFAULT NULL, |
|
361 |
"raw_user_info" varchar(1024) NOT NULL, |
|
362 |
"code" varchar(64) NOT NULL, |
|
363 |
"state" varchar(64), |
|
364 |
"creator" varchar(64) DEFAULT '', |
|
365 |
"create_time" timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, |
|
366 |
"updater" varchar(64) DEFAULT '', |
|
367 |
"update_time" timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, |
|
368 |
"deleted" bit NOT NULL DEFAULT FALSE, |
|
369 |
PRIMARY KEY ("id") |
|
370 |
) COMMENT '社交用户'; |
|
371 |
|
|
372 |
CREATE TABLE IF NOT EXISTS "system_social_user_bind" ( |
|
373 |
"id" bigint NOT NULL GENERATED BY DEFAULT AS IDENTITY, |
|
374 |
"user_id" bigint NOT NULL, |
|
375 |
"user_type" tinyint NOT NULL, |
|
376 |
"social_type" tinyint NOT NULL, |
|
377 |
"social_user_id" number NOT NULL, |
|
378 |
"creator" varchar(64) DEFAULT '', |
|
379 |
"create_time" timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, |
|
380 |
"updater" varchar(64) DEFAULT '', |
|
381 |
"update_time" timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, |
|
382 |
"deleted" bit NOT NULL DEFAULT FALSE, |
|
383 |
PRIMARY KEY ("id") |
|
384 |
) COMMENT '社交用户的绑定'; |
|
385 |
|
|
386 |
CREATE TABLE IF NOT EXISTS "system_tenant" ( |
|
387 |
"id" bigint NOT NULL GENERATED BY DEFAULT AS IDENTITY, |
|
388 |
"name" varchar(63) NOT NULL, |
|
389 |
"contact_user_id" bigint NOT NULL DEFAULT '0', |
|
390 |
"contact_name" varchar(255) NOT NULL, |
|
391 |
"contact_mobile" varchar(255), |
|
392 |
"status" tinyint NOT NULL, |
|
393 |
"website" varchar(63) DEFAULT '', |
|
394 |
"package_id" bigint NOT NULL, |
|
395 |
"expire_time" timestamp NOT NULL, |
|
396 |
"account_count" int NOT NULL, |
|
397 |
"creator" varchar(64) DEFAULT '', |
|
398 |
"create_time" timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, |
|
399 |
"updater" varchar(64) DEFAULT '', |
|
400 |
"update_time" timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, |
|
401 |
"deleted" bit NOT NULL DEFAULT FALSE, |
|
402 |
PRIMARY KEY ("id") |
|
403 |
) COMMENT '租户'; |
|
404 |
|
|
405 |
CREATE TABLE IF NOT EXISTS "system_tenant_package" ( |
|
406 |
"id" bigint NOT NULL GENERATED BY DEFAULT AS IDENTITY, |
|
407 |
"name" varchar(30) NOT NULL, |
|
408 |
"status" tinyint NOT NULL, |
|
409 |
"remark" varchar(256), |
|
410 |
"menu_ids" varchar(2048) NOT NULL, |
|
411 |
"creator" varchar(64) DEFAULT '', |
|
412 |
"create_time" datetime NOT NULL DEFAULT CURRENT_TIMESTAMP, |
|
413 |
"updater" varchar(64) DEFAULT '', |
|
414 |
"update_time" datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, |
|
415 |
"deleted" bit NOT NULL DEFAULT FALSE, |
|
416 |
PRIMARY KEY ("id") |
|
417 |
) COMMENT '租户套餐表'; |
|
418 |
|
|
419 |
CREATE TABLE IF NOT EXISTS "system_oauth2_client" ( |
|
420 |
"id" bigint NOT NULL GENERATED BY DEFAULT AS IDENTITY, |
|
421 |
"client_id" varchar NOT NULL, |
|
422 |
"secret" varchar NOT NULL, |
|
423 |
"name" varchar NOT NULL, |
|
424 |
"logo" varchar NOT NULL, |
|
425 |
"description" varchar, |
|
426 |
"status" int NOT NULL, |
|
427 |
"access_token_validity_seconds" int NOT NULL, |
|
428 |
"refresh_token_validity_seconds" int NOT NULL, |
|
429 |
"redirect_uris" varchar NOT NULL, |
|
430 |
"authorized_grant_types" varchar NOT NULL, |
|
431 |
"scopes" varchar NOT NULL DEFAULT '', |
|
432 |
"auto_approve_scopes" varchar NOT NULL DEFAULT '', |
|
433 |
"authorities" varchar NOT NULL DEFAULT '', |
|
434 |
"resource_ids" varchar NOT NULL DEFAULT '', |
|
435 |
"additional_information" varchar NOT NULL DEFAULT '', |
|
436 |
"creator" varchar DEFAULT '', |
|
437 |
"create_time" datetime NOT NULL DEFAULT CURRENT_TIMESTAMP, |
|
438 |
"updater" varchar DEFAULT '', |
|
439 |
"update_time" datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, |
|
440 |
"deleted" bit NOT NULL DEFAULT FALSE, |
|
441 |
PRIMARY KEY ("id") |
|
442 |
) COMMENT 'OAuth2 客户端表'; |
|
443 |
|
|
444 |
CREATE TABLE IF NOT EXISTS "system_oauth2_approve" ( |
|
445 |
"id" bigint NOT NULL GENERATED BY DEFAULT AS IDENTITY, |
|
446 |
"user_id" bigint NOT NULL, |
|
447 |
"user_type" tinyint NOT NULL, |
|
448 |
"client_id" varchar NOT NULL, |
|
449 |
"scope" varchar NOT NULL, |
|
450 |
"approved" bit NOT NULL DEFAULT FALSE, |
|
451 |
"expires_time" datetime NOT NULL, |
|
452 |
"creator" varchar DEFAULT '', |
|
453 |
"create_time" datetime NOT NULL DEFAULT CURRENT_TIMESTAMP, |
|
454 |
"updater" varchar DEFAULT '', |
|
455 |
"update_time" datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, |
|
456 |
"deleted" bit NOT NULL DEFAULT FALSE, |
|
457 |
PRIMARY KEY ("id") |
|
458 |
) COMMENT 'OAuth2 批准表'; |
|
459 |
|
|
460 |
CREATE TABLE IF NOT EXISTS "system_oauth2_access_token" ( |
|
461 |
"id" bigint NOT NULL GENERATED BY DEFAULT AS IDENTITY, |
|
462 |
"user_id" bigint NOT NULL, |
|
463 |
"user_type" tinyint NOT NULL, |
|
464 |
"user_info" varchar NOT NULL, |
|
465 |
"access_token" varchar NOT NULL, |
|
466 |
"refresh_token" varchar NOT NULL, |
|
467 |
"client_id" varchar NOT NULL, |
|
468 |
"scopes" varchar NOT NULL, |
|
469 |
"approved" bit NOT NULL DEFAULT FALSE, |
|
470 |
"expires_time" datetime NOT NULL, |
|
471 |
"creator" varchar DEFAULT '', |
|
472 |
"create_time" datetime NOT NULL DEFAULT CURRENT_TIMESTAMP, |
|
473 |
"updater" varchar DEFAULT '', |
|
474 |
"update_time" datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, |
|
475 |
"deleted" bit NOT NULL DEFAULT FALSE, |
|
476 |
"tenant_id" bigint NOT NULL, |
|
477 |
PRIMARY KEY ("id") |
|
478 |
) COMMENT 'OAuth2 访问令牌'; |
|
479 |
|
|
480 |
CREATE TABLE IF NOT EXISTS "system_oauth2_refresh_token" ( |
|
481 |
"id" bigint NOT NULL GENERATED BY DEFAULT AS IDENTITY, |
|
482 |
"user_id" bigint NOT NULL, |
|
483 |
"user_type" tinyint NOT NULL, |
|
484 |
"refresh_token" varchar NOT NULL, |
|
485 |
"client_id" varchar NOT NULL, |
|
486 |
"scopes" varchar NOT NULL, |
|
487 |
"approved" bit NOT NULL DEFAULT FALSE, |
|
488 |
"expires_time" datetime NOT NULL, |
|
489 |
"creator" varchar DEFAULT '', |
|
490 |
"create_time" datetime NOT NULL DEFAULT CURRENT_TIMESTAMP, |
|
491 |
"updater" varchar DEFAULT '', |
|
492 |
"update_time" datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, |
|
493 |
"deleted" bit NOT NULL DEFAULT FALSE, |
|
494 |
PRIMARY KEY ("id") |
|
495 |
) COMMENT 'OAuth2 刷新令牌'; |
|
496 |
|
|
497 |
CREATE TABLE IF NOT EXISTS "system_oauth2_code" ( |
|
498 |
"id" bigint NOT NULL GENERATED BY DEFAULT AS IDENTITY, |
|
499 |
"user_id" bigint NOT NULL, |
|
500 |
"user_type" tinyint NOT NULL, |
|
501 |
"code" varchar NOT NULL, |
|
502 |
"client_id" varchar NOT NULL, |
|
503 |
"scopes" varchar NOT NULL, |
|
504 |
"expires_time" datetime NOT NULL, |
|
505 |
"redirect_uri" varchar NOT NULL, |
|
506 |
"state" varchar NOT NULL, |
|
507 |
"creator" varchar DEFAULT '', |
|
508 |
"create_time" datetime NOT NULL DEFAULT CURRENT_TIMESTAMP, |
|
509 |
"updater" varchar DEFAULT '', |
|
510 |
"update_time" datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, |
|
511 |
"deleted" bit NOT NULL DEFAULT FALSE, |
|
512 |
PRIMARY KEY ("id") |
|
513 |
) COMMENT 'OAuth2 刷新令牌'; |
|
514 |
|
|
515 |
CREATE TABLE IF NOT EXISTS "system_mail_account" ( |
|
516 |
"id" bigint NOT NULL GENERATED BY DEFAULT AS IDENTITY, |
|
517 |
"mail" varchar NOT NULL, |
|
518 |
"username" varchar NOT NULL, |
|
519 |
"password" varchar NOT NULL, |
|
520 |
"host" varchar NOT NULL, |
|
521 |
"port" int NOT NULL, |
|
522 |
"ssl_enable" bit NOT NULL, |
|
523 |
"starttls_enable" bit NOT NULL, |
|
524 |
"creator" varchar DEFAULT '', |
|
525 |
"create_time" datetime NOT NULL DEFAULT CURRENT_TIMESTAMP, |
|
526 |
"updater" varchar DEFAULT '', |
|
527 |
"update_time" datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, |
|
528 |
"deleted" bit NOT NULL DEFAULT FALSE, |
|
529 |
PRIMARY KEY ("id") |
|
530 |
) COMMENT '邮箱账号表'; |
|
531 |
|
|
532 |
CREATE TABLE IF NOT EXISTS "system_mail_template" ( |
|
533 |
"id" bigint NOT NULL GENERATED BY DEFAULT AS IDENTITY, |
|
534 |
"name" varchar NOT NULL, |
|
535 |
"code" varchar NOT NULL, |
|
536 |
"account_id" bigint NOT NULL, |
|
537 |
"nickname" varchar, |
|
538 |
"title" varchar NOT NULL, |
|
539 |
"content" varchar NOT NULL, |
|
540 |
"params" varchar NOT NULL, |
|
541 |
"status" varchar NOT NULL, |
|
542 |
"remark" varchar, |
|
543 |
"creator" varchar DEFAULT '', |
|
544 |
"create_time" datetime NOT NULL DEFAULT CURRENT_TIMESTAMP, |
|
545 |
"updater" varchar DEFAULT '', |
|
546 |
"update_time" datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, |
|
547 |
"deleted" bit NOT NULL DEFAULT FALSE, |
|
548 |
PRIMARY KEY ("id") |
|
549 |
) COMMENT '邮件模版表'; |
|
550 |
|
|
551 |
CREATE TABLE IF NOT EXISTS "system_mail_log" ( |
|
552 |
"id" bigint NOT NULL GENERATED BY DEFAULT AS IDENTITY, |
|
553 |
"user_id" bigint, |
|
554 |
"user_type" varchar, |
|
555 |
"to_mail" varchar NOT NULL, |
|
556 |
"account_id" bigint NOT NULL, |
|
557 |
"from_mail" varchar NOT NULL, |
|
558 |
"template_id" bigint NOT NULL, |
|
559 |
"template_code" varchar NOT NULL, |
|
560 |
"template_nickname" varchar, |
|
561 |
"template_title" varchar NOT NULL, |
|
562 |
"template_content" varchar NOT NULL, |
|
563 |
"template_params" varchar NOT NULL, |
|
564 |
"send_status" varchar NOT NULL, |
|
565 |
"send_time" datetime, |
|
566 |
"send_message_id" varchar, |
|
567 |
"send_exception" varchar, |
|
568 |
"creator" varchar DEFAULT '', |
|
569 |
"create_time" datetime NOT NULL DEFAULT CURRENT_TIMESTAMP, |
|
570 |
"updater" varchar DEFAULT '', |
|
571 |
"update_time" datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, |
|
572 |
"deleted" bit NOT NULL DEFAULT FALSE, |
|
573 |
PRIMARY KEY ("id") |
|
574 |
) COMMENT '邮件日志表'; |
|
575 |
|
|
576 |
-- 将该建表 SQL 语句,添加到 iailab-module-system-biz 模块的 test/resources/sql/create_tables.sql 文件里 |
|
577 |
CREATE TABLE IF NOT EXISTS "system_notify_template" ( |
|
578 |
"id" bigint NOT NULL GENERATED BY DEFAULT AS IDENTITY, |
|
579 |
"name" varchar NOT NULL, |
|
580 |
"code" varchar NOT NULL, |
|
581 |
"nickname" varchar NOT NULL, |
|
582 |
"content" varchar NOT NULL, |
|
583 |
"type" varchar NOT NULL, |
|
584 |
"params" varchar, |
|
585 |
"status" varchar NOT NULL, |
|
586 |
"remark" varchar, |
|
587 |
"creator" varchar DEFAULT '', |
|
588 |
"create_time" datetime NOT NULL DEFAULT CURRENT_TIMESTAMP, |
|
589 |
"updater" varchar DEFAULT '', |
|
590 |
"update_time" datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, |
|
591 |
"deleted" bit NOT NULL DEFAULT FALSE, |
|
592 |
PRIMARY KEY ("id") |
|
593 |
) COMMENT '站内信模板表'; |
|
594 |
|
|
595 |
CREATE TABLE IF NOT EXISTS "system_notify_message" ( |
|
596 |
"id" bigint NOT NULL GENERATED BY DEFAULT AS IDENTITY, |
|
597 |
"user_id" bigint NOT NULL, |
|
598 |
"user_type" varchar NOT NULL, |
|
599 |
"template_id" bigint NOT NULL, |
|
600 |
"template_code" varchar NOT NULL, |
|
601 |
"template_nickname" varchar NOT NULL, |
|
602 |
"template_content" varchar NOT NULL, |
|
603 |
"template_type" int NOT NULL, |
|
604 |
"template_params" varchar NOT NULL, |
|
605 |
"read_status" bit NOT NULL, |
|
606 |
"read_time" varchar, |
|
607 |
"creator" varchar DEFAULT '', |
|
608 |
"create_time" datetime NOT NULL DEFAULT CURRENT_TIMESTAMP, |
|
609 |
"updater" varchar DEFAULT '', |
|
610 |
"update_time" datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, |
|
611 |
"deleted" bit NOT NULL DEFAULT FALSE, |
|
612 |
"tenant_id" bigint not null default '0', |
|
613 |
PRIMARY KEY ("id") |
|
614 |
) COMMENT '站内信消息表'; |