boyue_jnpf/sql_init/KingbaseES/jnpf_xxljob_init.sql

246 lines
12 KiB
MySQL
Raw Normal View History

2025-06-30 09:38:03 +08:00
CREATE TABLE base_handlername (
F_Id varchar(50) NOT NULL PRIMARY KEY ,
F_HandlerName varchar(50) NULL ,
F_Executor varchar(50) NULL
) ;
COMMENT ON TABLE base_handlername IS '';
COMMENT ON COLUMN base_handlername.F_Id IS '主键';
COMMENT ON COLUMN base_handlername.F_HandlerName IS '任务名称';
COMMENT ON COLUMN base_handlername.F_Executor IS '执行器名称';
CREATE TABLE base_timetask (
F_Id varchar(50) NOT NULL PRIMARY KEY ,
F_EnCode varchar(50) NULL ,
F_FullName varchar(100) NULL ,
F_ExecuteType varchar(50) NULL ,
F_ExecuteContent text NULL ,
F_ExecuteCycleJson text NULL ,
F_LastRunTime timestamp NULL ,
F_NextRunTime timestamp NULL ,
F_RunCount integer NULL ,
F_Description text NULL ,
F_SortCode bigint NULL ,
F_EnabledMark integer NULL ,
F_CreatorTime timestamp NULL ,
F_CreatorUserId varchar(50) NULL ,
F_LastModifyTime timestamp NULL ,
F_LastModifyUserId varchar(50) NULL ,
F_DeleteMark integer NULL ,
F_DeleteTime timestamp NULL ,
F_DeleteUserId varchar(50) NULL ,
F_ExecutorName varchar(50) NULL ,
F_TenantId varchar(50) NULL
) ;
COMMENT ON TABLE base_timetask IS '定时任务';
COMMENT ON COLUMN base_timetask.F_Id IS '自然主键';
COMMENT ON COLUMN base_timetask.F_EnCode IS '任务编码';
COMMENT ON COLUMN base_timetask.F_FullName IS '任务名称';
COMMENT ON COLUMN base_timetask.F_ExecuteType IS '执行类型';
COMMENT ON COLUMN base_timetask.F_ExecuteContent IS '执行内容';
COMMENT ON COLUMN base_timetask.F_ExecuteCycleJson IS '执行周期';
COMMENT ON COLUMN base_timetask.F_LastRunTime IS '最后运行时间';
COMMENT ON COLUMN base_timetask.F_NextRunTime IS '下次运行时间';
COMMENT ON COLUMN base_timetask.F_RunCount IS '运行次数';
COMMENT ON COLUMN base_timetask.F_Description IS '描述';
COMMENT ON COLUMN base_timetask.F_SortCode IS '排序';
COMMENT ON COLUMN base_timetask.F_EnabledMark IS '有效标志';
COMMENT ON COLUMN base_timetask.F_CreatorTime IS '创建时间';
COMMENT ON COLUMN base_timetask.F_CreatorUserId IS '创建用户';
COMMENT ON COLUMN base_timetask.F_LastModifyTime IS '修改时间';
COMMENT ON COLUMN base_timetask.F_LastModifyUserId IS '修改用户';
COMMENT ON COLUMN base_timetask.F_DeleteMark IS '删除标志';
COMMENT ON COLUMN base_timetask.F_DeleteTime IS '删除时间';
COMMENT ON COLUMN base_timetask.F_DeleteUserId IS '删除用户';
COMMENT ON COLUMN base_timetask.F_ExecutorName IS '执行器名称';
COMMENT ON COLUMN base_timetask.F_TenantId IS '租户id';
CREATE TABLE base_timetasklog (
F_Id varchar(50) NOT NULL PRIMARY KEY ,
F_TaskId varchar(50) NULL ,
F_RunTime timestamp NULL ,
F_RunResult integer NULL ,
F_Description text NULL
) ;
COMMENT ON TABLE base_timetasklog IS '定时任务记录';
COMMENT ON COLUMN base_timetasklog.F_Id IS '自然主键';
COMMENT ON COLUMN base_timetasklog.F_TaskId IS '定时任务主键';
COMMENT ON COLUMN base_timetasklog.F_RunTime IS '执行时间';
COMMENT ON COLUMN base_timetasklog.F_RunResult IS '执行结果';
COMMENT ON COLUMN base_timetasklog.F_Description IS '执行说明';
CREATE TABLE xxl_job_group (
id varchar(50) NOT NULL PRIMARY KEY ,
app_name varchar(64) NOT NULL ,
title varchar(64) NOT NULL ,
address_type tinyint NOT NULL ,
address_list text NULL ,
update_time timestamp NULL
) ;
COMMENT ON TABLE xxl_job_group IS '';
COMMENT ON COLUMN xxl_job_group.id IS '';
COMMENT ON COLUMN xxl_job_group.app_name IS '执行器AppName';
COMMENT ON COLUMN xxl_job_group.title IS '执行器名称';
COMMENT ON COLUMN xxl_job_group.address_type IS '执行器地址类型0=自动注册、1=手动录入';
COMMENT ON COLUMN xxl_job_group.address_list IS '执行器地址列表,多地址逗号分隔';
COMMENT ON COLUMN xxl_job_group.update_time IS '';
DELETE FROM xxl_job_group;
INSERT INTO xxl_job_group (app_name,update_time,address_type,address_list,id,title) VALUES ('xxl-job-executor-sample1','2022-12-12 18:13:35',0,'http://192.168.20.116:9999/','8','xxl-job-executor-sample1');
CREATE TABLE xxl_job_info (
id varchar(50) NOT NULL PRIMARY KEY ,
job_group varchar(50) NOT NULL ,
job_desc varchar(255) NOT NULL ,
add_time timestamp NULL ,
update_time timestamp NULL ,
author varchar(64) NULL ,
alarm_email varchar(255) NULL ,
schedule_type varchar(50) NOT NULL ,
schedule_conf varchar(128) NULL ,
misfire_strategy varchar(50) NOT NULL ,
executor_route_strategy varchar(50) NULL ,
executor_handler varchar(255) NULL ,
executor_param text NULL ,
executor_block_strategy varchar(50) NULL ,
executor_timeout integer NOT NULL ,
executor_fail_retry_count integer NOT NULL ,
glue_type varchar(50) NOT NULL ,
glue_source text NULL ,
glue_remark varchar(128) NULL ,
glue_updatetime timestamp NULL ,
child_jobid varchar(255) NULL ,
trigger_status tinyint NOT NULL ,
trigger_last_time bigint NOT NULL ,
trigger_next_time bigint NOT NULL ,
tenantId varchar(50) NULL ,
taskId varchar(50) NULL
) ;
COMMENT ON TABLE xxl_job_info IS '';
COMMENT ON COLUMN xxl_job_info.id IS '';
COMMENT ON COLUMN xxl_job_info.job_group IS '执行器主键ID';
COMMENT ON COLUMN xxl_job_info.job_desc IS '';
COMMENT ON COLUMN xxl_job_info.add_time IS '';
COMMENT ON COLUMN xxl_job_info.update_time IS '';
COMMENT ON COLUMN xxl_job_info.author IS '作者';
COMMENT ON COLUMN xxl_job_info.alarm_email IS '报警邮件';
COMMENT ON COLUMN xxl_job_info.schedule_type IS '调度类型';
COMMENT ON COLUMN xxl_job_info.schedule_conf IS '调度配置,值含义取决于调度类型';
COMMENT ON COLUMN xxl_job_info.misfire_strategy IS '调度过期策略';
COMMENT ON COLUMN xxl_job_info.executor_route_strategy IS '执行器路由策略';
COMMENT ON COLUMN xxl_job_info.executor_handler IS '执行器任务handler';
COMMENT ON COLUMN xxl_job_info.executor_param IS '执行器任务参数';
COMMENT ON COLUMN xxl_job_info.executor_block_strategy IS '阻塞处理策略';
COMMENT ON COLUMN xxl_job_info.executor_timeout IS '任务执行超时时间,单位秒';
COMMENT ON COLUMN xxl_job_info.executor_fail_retry_count IS '失败重试次数';
COMMENT ON COLUMN xxl_job_info.glue_type IS 'GLUE类型';
COMMENT ON COLUMN xxl_job_info.glue_source IS 'GLUE源代码';
COMMENT ON COLUMN xxl_job_info.glue_remark IS 'GLUE备注';
COMMENT ON COLUMN xxl_job_info.glue_updatetime IS 'GLUE更新时间';
COMMENT ON COLUMN xxl_job_info.child_jobid IS '子任务ID多个逗号分隔';
COMMENT ON COLUMN xxl_job_info.trigger_status IS '调度状态0-停止1-运行';
COMMENT ON COLUMN xxl_job_info.trigger_last_time IS '上次调度时间';
COMMENT ON COLUMN xxl_job_info.trigger_next_time IS '下次调度时间';
COMMENT ON COLUMN xxl_job_info.tenantId IS '租户编码';
COMMENT ON COLUMN xxl_job_info.taskId IS '任务id';
CREATE TABLE xxl_job_lock (
lock_name varchar(50) NOT NULL PRIMARY KEY
) ;
COMMENT ON TABLE xxl_job_lock IS '';
COMMENT ON COLUMN xxl_job_lock.lock_name IS '锁名称';
DELETE FROM xxl_job_lock;
INSERT INTO xxl_job_lock (lock_name) VALUES ('schedule_lock');
CREATE TABLE xxl_job_log (
id varchar(50) NOT NULL PRIMARY KEY ,
job_group varchar(50) NOT NULL ,
job_id varchar(50) NOT NULL ,
executor_address varchar(255) NULL ,
executor_handler varchar(255) NULL ,
executor_param text NULL ,
executor_sharding_param varchar(20) NULL ,
executor_fail_retry_count integer NOT NULL ,
trigger_time timestamp NULL ,
trigger_code integer NOT NULL ,
trigger_msg text NULL ,
handle_time timestamp NULL ,
handle_code integer NOT NULL ,
handle_msg text NULL ,
alarm_status tinyint NOT NULL
) ;
COMMENT ON TABLE xxl_job_log IS '';
COMMENT ON COLUMN xxl_job_log.id IS '';
COMMENT ON COLUMN xxl_job_log.job_group IS '执行器主键ID';
COMMENT ON COLUMN xxl_job_log.job_id IS '任务主键ID';
COMMENT ON COLUMN xxl_job_log.executor_address IS '执行器地址,本次执行的地址';
COMMENT ON COLUMN xxl_job_log.executor_handler IS '执行器任务handler';
COMMENT ON COLUMN xxl_job_log.executor_param IS '执行器任务参数';
COMMENT ON COLUMN xxl_job_log.executor_sharding_param IS '执行器任务分片参数,格式如 1/2';
COMMENT ON COLUMN xxl_job_log.executor_fail_retry_count IS '失败重试次数';
COMMENT ON COLUMN xxl_job_log.trigger_time IS '调度-时间';
COMMENT ON COLUMN xxl_job_log.trigger_code IS '调度-结果';
COMMENT ON COLUMN xxl_job_log.trigger_msg IS '调度-日志';
COMMENT ON COLUMN xxl_job_log.handle_time IS '执行-时间';
COMMENT ON COLUMN xxl_job_log.handle_code IS '执行-状态';
COMMENT ON COLUMN xxl_job_log.handle_msg IS '执行-日志';
COMMENT ON COLUMN xxl_job_log.alarm_status IS '告警状态0-默认、1-无需告警、2-告警成功、3-告警失败';
CREATE TABLE xxl_job_log_report (
id varchar(50) NOT NULL PRIMARY KEY ,
trigger_day timestamp NULL ,
running_count integer NOT NULL ,
suc_count integer NOT NULL ,
fail_count integer NOT NULL ,
update_time timestamp NULL
) ;
COMMENT ON TABLE xxl_job_log_report IS '';
COMMENT ON COLUMN xxl_job_log_report.id IS '';
COMMENT ON COLUMN xxl_job_log_report.trigger_day IS '调度-时间';
COMMENT ON COLUMN xxl_job_log_report.running_count IS '运行中-日志数量';
COMMENT ON COLUMN xxl_job_log_report.suc_count IS '执行成功-日志数量';
COMMENT ON COLUMN xxl_job_log_report.fail_count IS '执行失败-日志数量';
COMMENT ON COLUMN xxl_job_log_report.update_time IS '';
DELETE FROM xxl_job_log_report;
INSERT INTO xxl_job_log_report (suc_count,update_time,running_count,id,trigger_day,fail_count) VALUES (0,Null,0,'1602187341432389633','2022-12-12 00:00:00',0);
INSERT INTO xxl_job_log_report (suc_count,update_time,running_count,id,trigger_day,fail_count) VALUES (0,Null,0,'1602187341746962434','2022-12-11 00:00:00',0);
INSERT INTO xxl_job_log_report (suc_count,update_time,running_count,id,trigger_day,fail_count) VALUES (0,Null,0,'1602187342342553602','2022-12-10 00:00:00',0);
CREATE TABLE xxl_job_logglue (
id varchar(50) NOT NULL PRIMARY KEY ,
job_id varchar(50) NOT NULL ,
glue_type varchar(50) NULL ,
glue_source text NULL ,
glue_remark varchar(128) NOT NULL ,
add_time timestamp NULL ,
update_time timestamp NULL
) ;
COMMENT ON TABLE xxl_job_logglue IS '';
COMMENT ON COLUMN xxl_job_logglue.id IS '';
COMMENT ON COLUMN xxl_job_logglue.job_id IS '任务主键ID';
COMMENT ON COLUMN xxl_job_logglue.glue_type IS 'GLUE类型';
COMMENT ON COLUMN xxl_job_logglue.glue_source IS 'GLUE源代码';
COMMENT ON COLUMN xxl_job_logglue.glue_remark IS 'GLUE备注';
COMMENT ON COLUMN xxl_job_logglue.add_time IS '';
COMMENT ON COLUMN xxl_job_logglue.update_time IS '';
CREATE TABLE xxl_job_registry (
id varchar(50) NOT NULL PRIMARY KEY ,
registry_group varchar(50) NOT NULL ,
registry_key varchar(255) NOT NULL ,
registry_value varchar(255) NOT NULL ,
update_time timestamp NULL
) ;
COMMENT ON TABLE xxl_job_registry IS '';
COMMENT ON COLUMN xxl_job_registry.id IS '';
COMMENT ON COLUMN xxl_job_registry.registry_group IS '';
COMMENT ON COLUMN xxl_job_registry.registry_key IS '';
COMMENT ON COLUMN xxl_job_registry.registry_value IS '';
COMMENT ON COLUMN xxl_job_registry.update_time IS '';
DELETE FROM xxl_job_registry;
INSERT INTO xxl_job_registry (registry_key,registry_value,update_time,id,registry_group) VALUES ('xxl-job-executor-sample1','http://192.168.20.116:9999/','2022-12-12 18:13:29','1602242852609622017','EXECUTOR');
CREATE TABLE xxl_job_user (
id varchar(50) NOT NULL PRIMARY KEY ,
username varchar(50) NOT NULL ,
password varchar(50) NOT NULL ,
role tinyint NOT NULL ,
permission varchar(255) NULL
) ;
COMMENT ON TABLE xxl_job_user IS '';
COMMENT ON COLUMN xxl_job_user.id IS '';
COMMENT ON COLUMN xxl_job_user.username IS '账号';
COMMENT ON COLUMN xxl_job_user.password IS '密码';
COMMENT ON COLUMN xxl_job_user.role IS '角色0-普通用户、1-管理员';
COMMENT ON COLUMN xxl_job_user.permission IS '权限执行器ID列表多个逗号分割';
DELETE FROM xxl_job_user;
INSERT INTO xxl_job_user (password,role,permission,id,username) VALUES ('e10adc3949ba59abbe56e057f20f883e',1,Null,'1','admin');