tables_xxl_job.sql 8.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227
  1. CREATE database if NOT EXISTS `xxl-job` default character set utf8 collate utf8_general_ci;
  2. use `xxl-job`;
  3. CREATE TABLE XXL_JOB_QRTZ_JOB_DETAILS
  4. (
  5. SCHED_NAME VARCHAR(120) NOT NULL,
  6. JOB_NAME VARCHAR(200) NOT NULL,
  7. JOB_GROUP VARCHAR(200) NOT NULL,
  8. DESCRIPTION VARCHAR(250) NULL,
  9. JOB_CLASS_NAME VARCHAR(250) NOT NULL,
  10. IS_DURABLE VARCHAR(1) NOT NULL,
  11. IS_NONCONCURRENT VARCHAR(1) NOT NULL,
  12. IS_UPDATE_DATA VARCHAR(1) NOT NULL,
  13. REQUESTS_RECOVERY VARCHAR(1) NOT NULL,
  14. JOB_DATA BLOB NULL,
  15. PRIMARY KEY (SCHED_NAME,JOB_NAME,JOB_GROUP)
  16. );
  17. CREATE TABLE XXL_JOB_QRTZ_TRIGGERS
  18. (
  19. SCHED_NAME VARCHAR(120) NOT NULL,
  20. TRIGGER_NAME VARCHAR(200) NOT NULL,
  21. TRIGGER_GROUP VARCHAR(200) NOT NULL,
  22. JOB_NAME VARCHAR(200) NOT NULL,
  23. JOB_GROUP VARCHAR(200) NOT NULL,
  24. DESCRIPTION VARCHAR(250) NULL,
  25. NEXT_FIRE_TIME BIGINT(13) NULL,
  26. PREV_FIRE_TIME BIGINT(13) NULL,
  27. PRIORITY INTEGER NULL,
  28. TRIGGER_STATE VARCHAR(16) NOT NULL,
  29. TRIGGER_TYPE VARCHAR(8) NOT NULL,
  30. START_TIME BIGINT(13) NOT NULL,
  31. END_TIME BIGINT(13) NULL,
  32. CALENDAR_NAME VARCHAR(200) NULL,
  33. MISFIRE_INSTR SMALLINT(2) NULL,
  34. JOB_DATA BLOB NULL,
  35. PRIMARY KEY (SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP),
  36. FOREIGN KEY (SCHED_NAME,JOB_NAME,JOB_GROUP)
  37. REFERENCES XXL_JOB_QRTZ_JOB_DETAILS(SCHED_NAME,JOB_NAME,JOB_GROUP)
  38. );
  39. CREATE TABLE XXL_JOB_QRTZ_SIMPLE_TRIGGERS
  40. (
  41. SCHED_NAME VARCHAR(120) NOT NULL,
  42. TRIGGER_NAME VARCHAR(200) NOT NULL,
  43. TRIGGER_GROUP VARCHAR(200) NOT NULL,
  44. REPEAT_COUNT BIGINT(7) NOT NULL,
  45. REPEAT_INTERVAL BIGINT(12) NOT NULL,
  46. TIMES_TRIGGERED BIGINT(10) NOT NULL,
  47. PRIMARY KEY (SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP),
  48. FOREIGN KEY (SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP)
  49. REFERENCES XXL_JOB_QRTZ_TRIGGERS(SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP)
  50. );
  51. CREATE TABLE XXL_JOB_QRTZ_CRON_TRIGGERS
  52. (
  53. SCHED_NAME VARCHAR(120) NOT NULL,
  54. TRIGGER_NAME VARCHAR(200) NOT NULL,
  55. TRIGGER_GROUP VARCHAR(200) NOT NULL,
  56. CRON_EXPRESSION VARCHAR(200) NOT NULL,
  57. TIME_ZONE_ID VARCHAR(80),
  58. PRIMARY KEY (SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP),
  59. FOREIGN KEY (SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP)
  60. REFERENCES XXL_JOB_QRTZ_TRIGGERS(SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP)
  61. );
  62. CREATE TABLE XXL_JOB_QRTZ_SIMPROP_TRIGGERS
  63. (
  64. SCHED_NAME VARCHAR(120) NOT NULL,
  65. TRIGGER_NAME VARCHAR(200) NOT NULL,
  66. TRIGGER_GROUP VARCHAR(200) NOT NULL,
  67. STR_PROP_1 VARCHAR(512) NULL,
  68. STR_PROP_2 VARCHAR(512) NULL,
  69. STR_PROP_3 VARCHAR(512) NULL,
  70. INT_PROP_1 INT NULL,
  71. INT_PROP_2 INT NULL,
  72. LONG_PROP_1 BIGINT NULL,
  73. LONG_PROP_2 BIGINT NULL,
  74. DEC_PROP_1 NUMERIC(13,4) NULL,
  75. DEC_PROP_2 NUMERIC(13,4) NULL,
  76. BOOL_PROP_1 VARCHAR(1) NULL,
  77. BOOL_PROP_2 VARCHAR(1) NULL,
  78. PRIMARY KEY (SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP),
  79. FOREIGN KEY (SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP)
  80. REFERENCES XXL_JOB_QRTZ_TRIGGERS(SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP)
  81. );
  82. CREATE TABLE XXL_JOB_QRTZ_BLOB_TRIGGERS
  83. (
  84. SCHED_NAME VARCHAR(120) NOT NULL,
  85. TRIGGER_NAME VARCHAR(200) NOT NULL,
  86. TRIGGER_GROUP VARCHAR(200) NOT NULL,
  87. BLOB_DATA BLOB NULL,
  88. PRIMARY KEY (SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP),
  89. FOREIGN KEY (SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP)
  90. REFERENCES XXL_JOB_QRTZ_TRIGGERS(SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP)
  91. );
  92. CREATE TABLE XXL_JOB_QRTZ_CALENDARS
  93. (
  94. SCHED_NAME VARCHAR(120) NOT NULL,
  95. CALENDAR_NAME VARCHAR(200) NOT NULL,
  96. CALENDAR BLOB NOT NULL,
  97. PRIMARY KEY (SCHED_NAME,CALENDAR_NAME)
  98. );
  99. CREATE TABLE XXL_JOB_QRTZ_PAUSED_TRIGGER_GRPS
  100. (
  101. SCHED_NAME VARCHAR(120) NOT NULL,
  102. TRIGGER_GROUP VARCHAR(200) NOT NULL,
  103. PRIMARY KEY (SCHED_NAME,TRIGGER_GROUP)
  104. );
  105. CREATE TABLE XXL_JOB_QRTZ_FIRED_TRIGGERS
  106. (
  107. SCHED_NAME VARCHAR(120) NOT NULL,
  108. ENTRY_ID VARCHAR(95) NOT NULL,
  109. TRIGGER_NAME VARCHAR(200) NOT NULL,
  110. TRIGGER_GROUP VARCHAR(200) NOT NULL,
  111. INSTANCE_NAME VARCHAR(200) NOT NULL,
  112. FIRED_TIME BIGINT(13) NOT NULL,
  113. SCHED_TIME BIGINT(13) NOT NULL,
  114. PRIORITY INTEGER NOT NULL,
  115. STATE VARCHAR(16) NOT NULL,
  116. JOB_NAME VARCHAR(200) NULL,
  117. JOB_GROUP VARCHAR(200) NULL,
  118. IS_NONCONCURRENT VARCHAR(1) NULL,
  119. REQUESTS_RECOVERY VARCHAR(1) NULL,
  120. PRIMARY KEY (SCHED_NAME,ENTRY_ID)
  121. );
  122. CREATE TABLE XXL_JOB_QRTZ_SCHEDULER_STATE
  123. (
  124. SCHED_NAME VARCHAR(120) NOT NULL,
  125. INSTANCE_NAME VARCHAR(200) NOT NULL,
  126. LAST_CHECKIN_TIME BIGINT(13) NOT NULL,
  127. CHECKIN_INTERVAL BIGINT(13) NOT NULL,
  128. PRIMARY KEY (SCHED_NAME,INSTANCE_NAME)
  129. );
  130. CREATE TABLE XXL_JOB_QRTZ_LOCKS
  131. (
  132. SCHED_NAME VARCHAR(120) NOT NULL,
  133. LOCK_NAME VARCHAR(40) NOT NULL,
  134. PRIMARY KEY (SCHED_NAME,LOCK_NAME)
  135. );
  136. CREATE TABLE `XXL_JOB_QRTZ_TRIGGER_INFO` (
  137. `id` int(11) NOT NULL AUTO_INCREMENT,
  138. `job_group` int(11) NOT NULL COMMENT '执行器主键ID',
  139. `job_cron` varchar(128) NOT NULL COMMENT '任务执行CRON',
  140. `job_desc` varchar(255) NOT NULL,
  141. `add_time` datetime DEFAULT NULL,
  142. `update_time` datetime DEFAULT NULL,
  143. `author` varchar(64) DEFAULT NULL COMMENT '作者',
  144. `alarm_email` varchar(255) DEFAULT NULL COMMENT '报警邮件',
  145. `executor_route_strategy` varchar(50) DEFAULT NULL COMMENT '执行器路由策略',
  146. `executor_handler` varchar(255) DEFAULT NULL COMMENT '执行器任务handler',
  147. `executor_param` varchar(512) DEFAULT NULL COMMENT '执行器任务参数',
  148. `executor_block_strategy` varchar(50) DEFAULT NULL COMMENT '阻塞处理策略',
  149. `executor_timeout` int(11) NOT NULL DEFAULT '0' COMMENT '任务执行超时时间,单位秒',
  150. `executor_fail_retry_count` int(11) NOT NULL DEFAULT '0' COMMENT '失败重试次数',
  151. `glue_type` varchar(50) NOT NULL COMMENT 'GLUE类型',
  152. `glue_source` mediumtext COMMENT 'GLUE源代码',
  153. `glue_remark` varchar(128) DEFAULT NULL COMMENT 'GLUE备注',
  154. `glue_updatetime` datetime DEFAULT NULL COMMENT 'GLUE更新时间',
  155. `child_jobid` varchar(255) DEFAULT NULL COMMENT '子任务ID,多个逗号分隔',
  156. PRIMARY KEY (`id`)
  157. ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
  158. CREATE TABLE `XXL_JOB_QRTZ_TRIGGER_LOG` (
  159. `id` int(11) NOT NULL AUTO_INCREMENT,
  160. `job_group` int(11) NOT NULL COMMENT '执行器主键ID',
  161. `job_id` int(11) NOT NULL COMMENT '任务,主键ID',
  162. `executor_address` varchar(255) DEFAULT NULL COMMENT '执行器地址,本次执行的地址',
  163. `executor_handler` varchar(255) DEFAULT NULL COMMENT '执行器任务handler',
  164. `executor_param` varchar(512) DEFAULT NULL COMMENT '执行器任务参数',
  165. `executor_sharding_param` varchar(20) DEFAULT NULL COMMENT '执行器任务分片参数,格式如 1/2',
  166. `executor_fail_retry_count` int(11) NOT NULL DEFAULT '0' COMMENT '失败重试次数',
  167. `trigger_time` datetime DEFAULT NULL COMMENT '调度-时间',
  168. `trigger_code` int(11) NOT NULL COMMENT '调度-结果',
  169. `trigger_msg` text COMMENT '调度-日志',
  170. `handle_time` datetime DEFAULT NULL COMMENT '执行-时间',
  171. `handle_code` int(11) NOT NULL COMMENT '执行-状态',
  172. `handle_msg` text COMMENT '执行-日志',
  173. PRIMARY KEY (`id`),
  174. KEY `I_trigger_time` (`trigger_time`)
  175. ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
  176. CREATE TABLE `XXL_JOB_QRTZ_TRIGGER_LOGGLUE` (
  177. `id` int(11) NOT NULL AUTO_INCREMENT,
  178. `job_id` int(11) NOT NULL COMMENT '任务,主键ID',
  179. `glue_type` varchar(50) DEFAULT NULL COMMENT 'GLUE类型',
  180. `glue_source` mediumtext COMMENT 'GLUE源代码',
  181. `glue_remark` varchar(128) NOT NULL COMMENT 'GLUE备注',
  182. `add_time` timestamp NULL DEFAULT NULL,
  183. `update_time` timestamp NULL DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP,
  184. PRIMARY KEY (`id`)
  185. ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
  186. CREATE TABLE XXL_JOB_QRTZ_TRIGGER_REGISTRY (
  187. `id` int(11) NOT NULL AUTO_INCREMENT,
  188. `registry_group` varchar(255) NOT NULL,
  189. `registry_key` varchar(255) NOT NULL,
  190. `registry_value` varchar(255) NOT NULL,
  191. `update_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  192. PRIMARY KEY (`id`)
  193. ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
  194. CREATE TABLE `XXL_JOB_QRTZ_TRIGGER_GROUP` (
  195. `id` int(11) NOT NULL AUTO_INCREMENT,
  196. `app_name` varchar(64) NOT NULL COMMENT '执行器AppName',
  197. `title` varchar(12) NOT NULL COMMENT '执行器名称',
  198. `order` tinyint(4) NOT NULL DEFAULT '0' COMMENT '排序',
  199. `address_type` tinyint(4) NOT NULL DEFAULT '0' COMMENT '执行器地址类型:0=自动注册、1=手动录入',
  200. `address_list` varchar(512) DEFAULT NULL COMMENT '执行器地址列表,多地址逗号分隔',
  201. PRIMARY KEY (`id`)
  202. ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
  203. INSERT INTO `XXL_JOB_QRTZ_TRIGGER_GROUP` ( `app_name`, `title`, `order`, `address_type`, `address_list`) values ( 'xxl-job-executor-sample', '示例执行器', '1', '0', null);
  204. commit;