jnpf_xxljob_init.sql 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245
  1. CREATE TABLE base_handlername (
  2. F_Id varchar(50) NOT NULL PRIMARY KEY ,
  3. F_HandlerName varchar(50) NULL ,
  4. F_Executor varchar(50) NULL
  5. ) ;
  6. COMMENT ON TABLE base_handlername IS '';
  7. COMMENT ON COLUMN base_handlername.F_Id IS '主键';
  8. COMMENT ON COLUMN base_handlername.F_HandlerName IS '任务名称';
  9. COMMENT ON COLUMN base_handlername.F_Executor IS '执行器名称';
  10. CREATE TABLE base_timetask (
  11. F_Id varchar(50) NOT NULL PRIMARY KEY ,
  12. F_EnCode varchar(50) NULL ,
  13. F_FullName varchar(100) NULL ,
  14. F_ExecuteType varchar(50) NULL ,
  15. F_ExecuteContent text NULL ,
  16. F_ExecuteCycleJson text NULL ,
  17. F_LastRunTime timestamp NULL ,
  18. F_NextRunTime timestamp NULL ,
  19. F_RunCount integer NULL ,
  20. F_Description text NULL ,
  21. F_SortCode bigint NULL ,
  22. F_EnabledMark integer NULL ,
  23. F_CreatorTime timestamp NULL ,
  24. F_CreatorUserId varchar(50) NULL ,
  25. F_LastModifyTime timestamp NULL ,
  26. F_LastModifyUserId varchar(50) NULL ,
  27. F_DeleteMark integer NULL ,
  28. F_DeleteTime timestamp NULL ,
  29. F_DeleteUserId varchar(50) NULL ,
  30. F_ExecutorName varchar(50) NULL ,
  31. F_TenantId varchar(50) NULL
  32. ) ;
  33. COMMENT ON TABLE base_timetask IS '定时任务';
  34. COMMENT ON COLUMN base_timetask.F_Id IS '自然主键';
  35. COMMENT ON COLUMN base_timetask.F_EnCode IS '任务编码';
  36. COMMENT ON COLUMN base_timetask.F_FullName IS '任务名称';
  37. COMMENT ON COLUMN base_timetask.F_ExecuteType IS '执行类型';
  38. COMMENT ON COLUMN base_timetask.F_ExecuteContent IS '执行内容';
  39. COMMENT ON COLUMN base_timetask.F_ExecuteCycleJson IS '执行周期';
  40. COMMENT ON COLUMN base_timetask.F_LastRunTime IS '最后运行时间';
  41. COMMENT ON COLUMN base_timetask.F_NextRunTime IS '下次运行时间';
  42. COMMENT ON COLUMN base_timetask.F_RunCount IS '运行次数';
  43. COMMENT ON COLUMN base_timetask.F_Description IS '描述';
  44. COMMENT ON COLUMN base_timetask.F_SortCode IS '排序';
  45. COMMENT ON COLUMN base_timetask.F_EnabledMark IS '有效标志';
  46. COMMENT ON COLUMN base_timetask.F_CreatorTime IS '创建时间';
  47. COMMENT ON COLUMN base_timetask.F_CreatorUserId IS '创建用户';
  48. COMMENT ON COLUMN base_timetask.F_LastModifyTime IS '修改时间';
  49. COMMENT ON COLUMN base_timetask.F_LastModifyUserId IS '修改用户';
  50. COMMENT ON COLUMN base_timetask.F_DeleteMark IS '删除标志';
  51. COMMENT ON COLUMN base_timetask.F_DeleteTime IS '删除时间';
  52. COMMENT ON COLUMN base_timetask.F_DeleteUserId IS '删除用户';
  53. COMMENT ON COLUMN base_timetask.F_ExecutorName IS '执行器名称';
  54. COMMENT ON COLUMN base_timetask.F_TenantId IS '租户id';
  55. CREATE TABLE base_timetasklog (
  56. F_Id varchar(50) NOT NULL PRIMARY KEY ,
  57. F_TaskId varchar(50) NULL ,
  58. F_RunTime timestamp NULL ,
  59. F_RunResult integer NULL ,
  60. F_Description text NULL
  61. ) ;
  62. COMMENT ON TABLE base_timetasklog IS '定时任务记录';
  63. COMMENT ON COLUMN base_timetasklog.F_Id IS '自然主键';
  64. COMMENT ON COLUMN base_timetasklog.F_TaskId IS '定时任务主键';
  65. COMMENT ON COLUMN base_timetasklog.F_RunTime IS '执行时间';
  66. COMMENT ON COLUMN base_timetasklog.F_RunResult IS '执行结果';
  67. COMMENT ON COLUMN base_timetasklog.F_Description IS '执行说明';
  68. CREATE TABLE xxl_job_group (
  69. id varchar(50) NOT NULL PRIMARY KEY ,
  70. app_name varchar(64) NOT NULL ,
  71. title varchar(64) NOT NULL ,
  72. address_type tinyint NOT NULL ,
  73. address_list text NULL ,
  74. update_time timestamp NULL
  75. ) ;
  76. COMMENT ON TABLE xxl_job_group IS '';
  77. COMMENT ON COLUMN xxl_job_group.id IS '';
  78. COMMENT ON COLUMN xxl_job_group.app_name IS '执行器AppName';
  79. COMMENT ON COLUMN xxl_job_group.title IS '执行器名称';
  80. COMMENT ON COLUMN xxl_job_group.address_type IS '执行器地址类型:0=自动注册、1=手动录入';
  81. COMMENT ON COLUMN xxl_job_group.address_list IS '执行器地址列表,多地址逗号分隔';
  82. COMMENT ON COLUMN xxl_job_group.update_time IS '';
  83. DELETE FROM xxl_job_group;
  84. 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');
  85. CREATE TABLE xxl_job_info (
  86. id varchar(50) NOT NULL PRIMARY KEY ,
  87. job_group varchar(50) NOT NULL ,
  88. job_desc varchar(255) NOT NULL ,
  89. add_time timestamp NULL ,
  90. update_time timestamp NULL ,
  91. author varchar(64) NULL ,
  92. alarm_email varchar(255) NULL ,
  93. schedule_type varchar(50) NOT NULL ,
  94. schedule_conf varchar(128) NULL ,
  95. misfire_strategy varchar(50) NOT NULL ,
  96. executor_route_strategy varchar(50) NULL ,
  97. executor_handler varchar(255) NULL ,
  98. executor_param text NULL ,
  99. executor_block_strategy varchar(50) NULL ,
  100. executor_timeout integer NOT NULL ,
  101. executor_fail_retry_count integer NOT NULL ,
  102. glue_type varchar(50) NOT NULL ,
  103. glue_source text NULL ,
  104. glue_remark varchar(128) NULL ,
  105. glue_updatetime timestamp NULL ,
  106. child_jobid varchar(255) NULL ,
  107. trigger_status tinyint NOT NULL ,
  108. trigger_last_time bigint NOT NULL ,
  109. trigger_next_time bigint NOT NULL ,
  110. tenantId varchar(50) NULL ,
  111. taskId varchar(50) NULL
  112. ) ;
  113. COMMENT ON TABLE xxl_job_info IS '';
  114. COMMENT ON COLUMN xxl_job_info.id IS '';
  115. COMMENT ON COLUMN xxl_job_info.job_group IS '执行器主键ID';
  116. COMMENT ON COLUMN xxl_job_info.job_desc IS '';
  117. COMMENT ON COLUMN xxl_job_info.add_time IS '';
  118. COMMENT ON COLUMN xxl_job_info.update_time IS '';
  119. COMMENT ON COLUMN xxl_job_info.author IS '作者';
  120. COMMENT ON COLUMN xxl_job_info.alarm_email IS '报警邮件';
  121. COMMENT ON COLUMN xxl_job_info.schedule_type IS '调度类型';
  122. COMMENT ON COLUMN xxl_job_info.schedule_conf IS '调度配置,值含义取决于调度类型';
  123. COMMENT ON COLUMN xxl_job_info.misfire_strategy IS '调度过期策略';
  124. COMMENT ON COLUMN xxl_job_info.executor_route_strategy IS '执行器路由策略';
  125. COMMENT ON COLUMN xxl_job_info.executor_handler IS '执行器任务handler';
  126. COMMENT ON COLUMN xxl_job_info.executor_param IS '执行器任务参数';
  127. COMMENT ON COLUMN xxl_job_info.executor_block_strategy IS '阻塞处理策略';
  128. COMMENT ON COLUMN xxl_job_info.executor_timeout IS '任务执行超时时间,单位秒';
  129. COMMENT ON COLUMN xxl_job_info.executor_fail_retry_count IS '失败重试次数';
  130. COMMENT ON COLUMN xxl_job_info.glue_type IS 'GLUE类型';
  131. COMMENT ON COLUMN xxl_job_info.glue_source IS 'GLUE源代码';
  132. COMMENT ON COLUMN xxl_job_info.glue_remark IS 'GLUE备注';
  133. COMMENT ON COLUMN xxl_job_info.glue_updatetime IS 'GLUE更新时间';
  134. COMMENT ON COLUMN xxl_job_info.child_jobid IS '子任务ID,多个逗号分隔';
  135. COMMENT ON COLUMN xxl_job_info.trigger_status IS '调度状态:0-停止,1-运行';
  136. COMMENT ON COLUMN xxl_job_info.trigger_last_time IS '上次调度时间';
  137. COMMENT ON COLUMN xxl_job_info.trigger_next_time IS '下次调度时间';
  138. COMMENT ON COLUMN xxl_job_info.tenantId IS '租户编码';
  139. COMMENT ON COLUMN xxl_job_info.taskId IS '任务id';
  140. CREATE TABLE xxl_job_lock (
  141. lock_name varchar(50) NOT NULL PRIMARY KEY
  142. ) ;
  143. COMMENT ON TABLE xxl_job_lock IS '';
  144. COMMENT ON COLUMN xxl_job_lock.lock_name IS '锁名称';
  145. DELETE FROM xxl_job_lock;
  146. INSERT INTO xxl_job_lock (lock_name) VALUES ('schedule_lock');
  147. CREATE TABLE xxl_job_log (
  148. id varchar(50) NOT NULL PRIMARY KEY ,
  149. job_group varchar(50) NOT NULL ,
  150. job_id varchar(50) NOT NULL ,
  151. executor_address varchar(255) NULL ,
  152. executor_handler varchar(255) NULL ,
  153. executor_param text NULL ,
  154. executor_sharding_param varchar(20) NULL ,
  155. executor_fail_retry_count integer NOT NULL ,
  156. trigger_time timestamp NULL ,
  157. trigger_code integer NOT NULL ,
  158. trigger_msg text NULL ,
  159. handle_time timestamp NULL ,
  160. handle_code integer NOT NULL ,
  161. handle_msg text NULL ,
  162. alarm_status tinyint NOT NULL
  163. ) ;
  164. COMMENT ON TABLE xxl_job_log IS '';
  165. COMMENT ON COLUMN xxl_job_log.id IS '';
  166. COMMENT ON COLUMN xxl_job_log.job_group IS '执行器主键ID';
  167. COMMENT ON COLUMN xxl_job_log.job_id IS '任务,主键ID';
  168. COMMENT ON COLUMN xxl_job_log.executor_address IS '执行器地址,本次执行的地址';
  169. COMMENT ON COLUMN xxl_job_log.executor_handler IS '执行器任务handler';
  170. COMMENT ON COLUMN xxl_job_log.executor_param IS '执行器任务参数';
  171. COMMENT ON COLUMN xxl_job_log.executor_sharding_param IS '执行器任务分片参数,格式如 1/2';
  172. COMMENT ON COLUMN xxl_job_log.executor_fail_retry_count IS '失败重试次数';
  173. COMMENT ON COLUMN xxl_job_log.trigger_time IS '调度-时间';
  174. COMMENT ON COLUMN xxl_job_log.trigger_code IS '调度-结果';
  175. COMMENT ON COLUMN xxl_job_log.trigger_msg IS '调度-日志';
  176. COMMENT ON COLUMN xxl_job_log.handle_time IS '执行-时间';
  177. COMMENT ON COLUMN xxl_job_log.handle_code IS '执行-状态';
  178. COMMENT ON COLUMN xxl_job_log.handle_msg IS '执行-日志';
  179. COMMENT ON COLUMN xxl_job_log.alarm_status IS '告警状态:0-默认、1-无需告警、2-告警成功、3-告警失败';
  180. CREATE TABLE xxl_job_log_report (
  181. id varchar(50) NOT NULL PRIMARY KEY ,
  182. trigger_day timestamp NULL ,
  183. running_count integer NOT NULL ,
  184. suc_count integer NOT NULL ,
  185. fail_count integer NOT NULL ,
  186. update_time timestamp NULL
  187. ) ;
  188. COMMENT ON TABLE xxl_job_log_report IS '';
  189. COMMENT ON COLUMN xxl_job_log_report.id IS '';
  190. COMMENT ON COLUMN xxl_job_log_report.trigger_day IS '调度-时间';
  191. COMMENT ON COLUMN xxl_job_log_report.running_count IS '运行中-日志数量';
  192. COMMENT ON COLUMN xxl_job_log_report.suc_count IS '执行成功-日志数量';
  193. COMMENT ON COLUMN xxl_job_log_report.fail_count IS '执行失败-日志数量';
  194. COMMENT ON COLUMN xxl_job_log_report.update_time IS '';
  195. DELETE FROM xxl_job_log_report;
  196. 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);
  197. 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);
  198. 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);
  199. CREATE TABLE xxl_job_logglue (
  200. id varchar(50) NOT NULL PRIMARY KEY ,
  201. job_id varchar(50) NOT NULL ,
  202. glue_type varchar(50) NULL ,
  203. glue_source text NULL ,
  204. glue_remark varchar(128) NOT NULL ,
  205. add_time timestamp NULL ,
  206. update_time timestamp NULL
  207. ) ;
  208. COMMENT ON TABLE xxl_job_logglue IS '';
  209. COMMENT ON COLUMN xxl_job_logglue.id IS '';
  210. COMMENT ON COLUMN xxl_job_logglue.job_id IS '任务,主键ID';
  211. COMMENT ON COLUMN xxl_job_logglue.glue_type IS 'GLUE类型';
  212. COMMENT ON COLUMN xxl_job_logglue.glue_source IS 'GLUE源代码';
  213. COMMENT ON COLUMN xxl_job_logglue.glue_remark IS 'GLUE备注';
  214. COMMENT ON COLUMN xxl_job_logglue.add_time IS '';
  215. COMMENT ON COLUMN xxl_job_logglue.update_time IS '';
  216. CREATE TABLE xxl_job_registry (
  217. id varchar(50) NOT NULL PRIMARY KEY ,
  218. registry_group varchar(50) NOT NULL ,
  219. registry_key varchar(255) NOT NULL ,
  220. registry_value varchar(255) NOT NULL ,
  221. update_time timestamp NULL
  222. ) ;
  223. COMMENT ON TABLE xxl_job_registry IS '';
  224. COMMENT ON COLUMN xxl_job_registry.id IS '';
  225. COMMENT ON COLUMN xxl_job_registry.registry_group IS '';
  226. COMMENT ON COLUMN xxl_job_registry.registry_key IS '';
  227. COMMENT ON COLUMN xxl_job_registry.registry_value IS '';
  228. COMMENT ON COLUMN xxl_job_registry.update_time IS '';
  229. DELETE FROM xxl_job_registry;
  230. 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');
  231. CREATE TABLE xxl_job_user (
  232. id varchar(50) NOT NULL PRIMARY KEY ,
  233. username varchar(50) NOT NULL ,
  234. password varchar(50) NOT NULL ,
  235. role tinyint NOT NULL ,
  236. permission varchar(255) NULL
  237. ) ;
  238. COMMENT ON TABLE xxl_job_user IS '';
  239. COMMENT ON COLUMN xxl_job_user.id IS '';
  240. COMMENT ON COLUMN xxl_job_user.username IS '账号';
  241. COMMENT ON COLUMN xxl_job_user.password IS '密码';
  242. COMMENT ON COLUMN xxl_job_user.role IS '角色:0-普通用户、1-管理员';
  243. COMMENT ON COLUMN xxl_job_user.permission IS '权限:执行器ID列表,多个逗号分割';
  244. DELETE FROM xxl_job_user;
  245. INSERT INTO xxl_job_user (password,role,permission,id,username) VALUES ('e10adc3949ba59abbe56e057f20f883e',1,Null,'1','admin');