tables_xxl_job.sql 8.4 KB

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