table_xxl_job-pg.sql 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304
  1. /*
  2. Navicat Premium Data Transfer
  3. Source Server : 47.108.51.144
  4. Source Server Type : PostgreSQL
  5. Source Server Version : 120004
  6. Source Host : 47.108.51.144:13002
  7. Source Catalog : xxl-job
  8. Source Schema : public
  9. Target Server Type : PostgreSQL
  10. Target Server Version : 120004
  11. File Encoding : 65001
  12. Date: 22/09/2020 12:35:17
  13. */
  14. -- ----------------------------
  15. -- Table structure for xxl_job_group
  16. -- ----------------------------
  17. DROP TABLE IF EXISTS "xxl_job_group";
  18. CREATE TABLE "xxl_job_group" (
  19. "id" int8 NOT NULL,
  20. "app_name" varchar(64) COLLATE "pg_catalog"."default" NOT NULL,
  21. "title" varchar(12) COLLATE "pg_catalog"."default" NOT NULL,
  22. "address_type" int2 NOT NULL,
  23. "address_list" varchar(512) COLLATE "pg_catalog"."default"
  24. )
  25. ;
  26. COMMENT ON COLUMN "xxl_job_group"."app_name" IS '执行器AppName';
  27. COMMENT ON COLUMN "xxl_job_group"."title" IS '执行器名称';
  28. COMMENT ON COLUMN "xxl_job_group"."address_type" IS '执行器地址类型:0=自动注册、1=手动录入';
  29. COMMENT ON COLUMN "xxl_job_group"."address_list" IS '执行器地址列表,多地址逗号分隔';
  30. -- ----------------------------
  31. -- Records of xxl_job_group
  32. -- ----------------------------
  33. INSERT INTO "xxl_job_group" VALUES (1, 'xxl-job-executor-sample', '示例执行器', 0, NULL);
  34. -- ----------------------------
  35. -- Table structure for xxl_job_info
  36. -- ----------------------------
  37. DROP TABLE IF EXISTS "xxl_job_info";
  38. CREATE TABLE "xxl_job_info" (
  39. "id" int8 NOT NULL,
  40. "job_group" int8 NOT NULL,
  41. "job_cron" varchar(128) COLLATE "pg_catalog"."default" NOT NULL,
  42. "job_desc" varchar(255) COLLATE "pg_catalog"."default" NOT NULL,
  43. "add_time" timestamp(6),
  44. "update_time" timestamp(6),
  45. "author" varchar(64) COLLATE "pg_catalog"."default",
  46. "alarm_email" varchar(255) COLLATE "pg_catalog"."default",
  47. "executor_route_strategy" varchar(50) COLLATE "pg_catalog"."default",
  48. "executor_handler" varchar(255) COLLATE "pg_catalog"."default",
  49. "executor_param" varchar(512) COLLATE "pg_catalog"."default",
  50. "executor_block_strategy" varchar(50) COLLATE "pg_catalog"."default",
  51. "executor_timeout" int4 NOT NULL,
  52. "executor_fail_retry_count" int4 NOT NULL,
  53. "glue_type" varchar(50) COLLATE "pg_catalog"."default" NOT NULL,
  54. "glue_source" text COLLATE "pg_catalog"."default",
  55. "glue_remark" varchar(128) COLLATE "pg_catalog"."default",
  56. "glue_updatetime" timestamp(6),
  57. "child_jobid" varchar(255) COLLATE "pg_catalog"."default",
  58. "trigger_status" int2 NOT NULL,
  59. "trigger_last_time" int8 NOT NULL,
  60. "trigger_next_time" int8 NOT NULL
  61. )
  62. ;
  63. COMMENT ON COLUMN "xxl_job_info"."job_group" IS '执行器主键ID';
  64. COMMENT ON COLUMN "xxl_job_info"."job_cron" IS '任务执行CRON';
  65. COMMENT ON COLUMN "xxl_job_info"."author" IS '作者';
  66. COMMENT ON COLUMN "xxl_job_info"."alarm_email" IS '报警邮件';
  67. COMMENT ON COLUMN "xxl_job_info"."executor_route_strategy" IS '执行器路由策略';
  68. COMMENT ON COLUMN "xxl_job_info"."executor_handler" IS '执行器任务handler';
  69. COMMENT ON COLUMN "xxl_job_info"."executor_param" IS '执行器任务参数';
  70. COMMENT ON COLUMN "xxl_job_info"."executor_block_strategy" IS '阻塞处理策略';
  71. COMMENT ON COLUMN "xxl_job_info"."executor_timeout" IS '任务执行超时时间,单位秒';
  72. COMMENT ON COLUMN "xxl_job_info"."executor_fail_retry_count" IS '失败重试次数';
  73. COMMENT ON COLUMN "xxl_job_info"."glue_type" IS 'GLUE类型';
  74. COMMENT ON COLUMN "xxl_job_info"."glue_source" IS 'GLUE源代码';
  75. COMMENT ON COLUMN "xxl_job_info"."glue_remark" IS 'GLUE备注';
  76. COMMENT ON COLUMN "xxl_job_info"."glue_updatetime" IS 'GLUE更新时间';
  77. COMMENT ON COLUMN "xxl_job_info"."child_jobid" IS '子任务ID,多个逗号分隔';
  78. COMMENT ON COLUMN "xxl_job_info"."trigger_status" IS '调度状态:0-停止,1-运行';
  79. COMMENT ON COLUMN "xxl_job_info"."trigger_last_time" IS '上次调度时间';
  80. COMMENT ON COLUMN "xxl_job_info"."trigger_next_time" IS '下次调度时间';
  81. -- ----------------------------
  82. -- Records of xxl_job_info
  83. -- ----------------------------
  84. INSERT INTO "xxl_job_info" VALUES (1, 1, '0 0 0 * * ? *', '测试任务1', '2018-11-03 22:21:31', '2018-11-03 22:21:31', 'XXL', '', 'FIRST', 'demoJobHandler', '', 'SERIAL_EXECUTION', 0, 0, 'BEAN', '', 'GLUE代码初始化', '2018-11-03 22:21:31', '', 0, 0, 0);
  85. -- ----------------------------
  86. -- Table structure for xxl_job_lock
  87. -- ----------------------------
  88. DROP TABLE IF EXISTS "xxl_job_lock";
  89. CREATE TABLE "xxl_job_lock" (
  90. "lock_name" varchar(50) COLLATE "pg_catalog"."default" NOT NULL
  91. )
  92. ;
  93. COMMENT ON COLUMN "xxl_job_lock"."lock_name" IS '锁名称';
  94. -- ----------------------------
  95. -- Records of xxl_job_lock
  96. -- ----------------------------
  97. INSERT INTO "xxl_job_lock" VALUES ('schedule_lock');
  98. -- ----------------------------
  99. -- Table structure for xxl_job_log
  100. -- ----------------------------
  101. DROP TABLE IF EXISTS "xxl_job_log";
  102. CREATE TABLE "xxl_job_log" (
  103. "id" int8 NOT NULL,
  104. "job_group" int8 NOT NULL,
  105. "job_id" int8 NOT NULL,
  106. "executor_address" varchar(255) COLLATE "pg_catalog"."default",
  107. "executor_handler" varchar(255) COLLATE "pg_catalog"."default",
  108. "executor_param" varchar(512) COLLATE "pg_catalog"."default",
  109. "executor_sharding_param" varchar(20) COLLATE "pg_catalog"."default",
  110. "executor_fail_retry_count" int4 NOT NULL,
  111. "trigger_time" timestamp(6),
  112. "trigger_code" int4 NOT NULL,
  113. "trigger_msg" text COLLATE "pg_catalog"."default",
  114. "handle_time" timestamp(6),
  115. "handle_code" int4 NOT NULL,
  116. "handle_msg" text COLLATE "pg_catalog"."default",
  117. "alarm_status" int2 NOT NULL
  118. )
  119. ;
  120. COMMENT ON COLUMN "xxl_job_log"."job_group" IS '执行器主键ID';
  121. COMMENT ON COLUMN "xxl_job_log"."job_id" IS '任务,主键ID';
  122. COMMENT ON COLUMN "xxl_job_log"."executor_address" IS '执行器地址,本次执行的地址';
  123. COMMENT ON COLUMN "xxl_job_log"."executor_handler" IS '执行器任务handler';
  124. COMMENT ON COLUMN "xxl_job_log"."executor_param" IS '执行器任务参数';
  125. COMMENT ON COLUMN "xxl_job_log"."executor_sharding_param" IS '执行器任务分片参数,格式如 1/2';
  126. COMMENT ON COLUMN "xxl_job_log"."executor_fail_retry_count" IS '失败重试次数';
  127. COMMENT ON COLUMN "xxl_job_log"."trigger_time" IS '调度-时间';
  128. COMMENT ON COLUMN "xxl_job_log"."trigger_code" IS '调度-结果';
  129. COMMENT ON COLUMN "xxl_job_log"."trigger_msg" IS '调度-日志';
  130. COMMENT ON COLUMN "xxl_job_log"."handle_time" IS '执行-时间';
  131. COMMENT ON COLUMN "xxl_job_log"."handle_code" IS '执行-状态';
  132. COMMENT ON COLUMN "xxl_job_log"."handle_msg" IS '执行-日志';
  133. COMMENT ON COLUMN "xxl_job_log"."alarm_status" IS '告警状态:0-默认、1-无需告警、2-告警成功、3-告警失败';
  134. -- ----------------------------
  135. -- Records of xxl_job_log
  136. -- ----------------------------
  137. -- ----------------------------
  138. -- Table structure for xxl_job_log_report
  139. -- ----------------------------
  140. DROP TABLE IF EXISTS "xxl_job_log_report";
  141. CREATE TABLE "xxl_job_log_report" (
  142. "id" int8 NOT NULL,
  143. "trigger_day" timestamp(6),
  144. "running_count" int4 NOT NULL,
  145. "suc_count" int4 NOT NULL,
  146. "fail_count" int4 NOT NULL
  147. )
  148. ;
  149. COMMENT ON COLUMN "xxl_job_log_report"."trigger_day" IS '调度-时间';
  150. COMMENT ON COLUMN "xxl_job_log_report"."running_count" IS '运行中-日志数量';
  151. COMMENT ON COLUMN "xxl_job_log_report"."suc_count" IS '执行成功-日志数量';
  152. COMMENT ON COLUMN "xxl_job_log_report"."fail_count" IS '执行失败-日志数量';
  153. -- ----------------------------
  154. -- Records of xxl_job_log_report
  155. -- ----------------------------
  156. -- ----------------------------
  157. -- Table structure for xxl_job_logglue
  158. -- ----------------------------
  159. DROP TABLE IF EXISTS "xxl_job_logglue";
  160. CREATE TABLE "xxl_job_logglue" (
  161. "id" int8 NOT NULL,
  162. "job_id" int8 NOT NULL,
  163. "glue_type" varchar(50) COLLATE "pg_catalog"."default",
  164. "glue_source" text COLLATE "pg_catalog"."default",
  165. "glue_remark" varchar(128) COLLATE "pg_catalog"."default" NOT NULL,
  166. "add_time" timestamp(6),
  167. "update_time" timestamp(6)
  168. )
  169. ;
  170. COMMENT ON COLUMN "xxl_job_logglue"."job_id" IS '任务,主键ID';
  171. COMMENT ON COLUMN "xxl_job_logglue"."glue_type" IS 'GLUE类型';
  172. COMMENT ON COLUMN "xxl_job_logglue"."glue_source" IS 'GLUE源代码';
  173. COMMENT ON COLUMN "xxl_job_logglue"."glue_remark" IS 'GLUE备注';
  174. -- ----------------------------
  175. -- Records of xxl_job_logglue
  176. -- ----------------------------
  177. -- ----------------------------
  178. -- Table structure for xxl_job_registry
  179. -- ----------------------------
  180. DROP TABLE IF EXISTS "xxl_job_registry";
  181. CREATE TABLE "xxl_job_registry" (
  182. "id" int8 NOT NULL,
  183. "registry_group" varchar(50) COLLATE "pg_catalog"."default" NOT NULL,
  184. "registry_key" varchar(255) COLLATE "pg_catalog"."default" NOT NULL,
  185. "registry_value" varchar(255) COLLATE "pg_catalog"."default" NOT NULL,
  186. "update_time" timestamp(6)
  187. )
  188. ;
  189. -- ----------------------------
  190. -- Records of xxl_job_registry
  191. -- ----------------------------
  192. -- ----------------------------
  193. -- Table structure for xxl_job_user
  194. -- ----------------------------
  195. DROP TABLE IF EXISTS "xxl_job_user";
  196. CREATE TABLE "xxl_job_user" (
  197. "id" int8 NOT NULL,
  198. "username" varchar(50) COLLATE "pg_catalog"."default" NOT NULL,
  199. "password" varchar(50) COLLATE "pg_catalog"."default" NOT NULL,
  200. "role" int2 NOT NULL,
  201. "permission" varchar(255) COLLATE "pg_catalog"."default"
  202. )
  203. ;
  204. COMMENT ON COLUMN "xxl_job_user"."username" IS '账号';
  205. COMMENT ON COLUMN "xxl_job_user"."password" IS '密码';
  206. COMMENT ON COLUMN "xxl_job_user"."role" IS '角色:0-普通用户、1-管理员';
  207. COMMENT ON COLUMN "xxl_job_user"."permission" IS '权限:执行器ID列表,多个逗号分割';
  208. -- ----------------------------
  209. -- Records of xxl_job_user
  210. -- ----------------------------
  211. INSERT INTO "xxl_job_user" VALUES (1, 'admin', 'e10adc3949ba59abbe56e057f20f883e', 1, NULL);
  212. -- ----------------------------
  213. -- Primary Key structure for table xxl_job_group
  214. -- ----------------------------
  215. ALTER TABLE "xxl_job_group" ADD CONSTRAINT "xxl_job_group_pkey" PRIMARY KEY ("id");
  216. -- ----------------------------
  217. -- Primary Key structure for table xxl_job_info
  218. -- ----------------------------
  219. ALTER TABLE "xxl_job_info" ADD CONSTRAINT "xxl_job_info_pkey" PRIMARY KEY ("id");
  220. -- ----------------------------
  221. -- Primary Key structure for table xxl_job_lock
  222. -- ----------------------------
  223. ALTER TABLE "xxl_job_lock" ADD CONSTRAINT "xxl_job_lock_pkey" PRIMARY KEY ("lock_name");
  224. -- ----------------------------
  225. -- Indexes structure for table xxl_job_log
  226. -- ----------------------------
  227. CREATE INDEX "I_handle_code" ON "xxl_job_log" USING btree (
  228. "handle_code" "pg_catalog"."int4_ops" ASC NULLS LAST
  229. );
  230. CREATE INDEX "I_trigger_time" ON "xxl_job_log" USING btree (
  231. "trigger_time" "pg_catalog"."timestamp_ops" ASC NULLS LAST
  232. );
  233. -- ----------------------------
  234. -- Primary Key structure for table xxl_job_log
  235. -- ----------------------------
  236. ALTER TABLE "xxl_job_log" ADD CONSTRAINT "xxl_job_log_pkey" PRIMARY KEY ("id");
  237. -- ----------------------------
  238. -- Indexes structure for table xxl_job_log_report
  239. -- ----------------------------
  240. CREATE INDEX "i_trigger_day" ON "xxl_job_log_report" USING btree (
  241. "trigger_day" "pg_catalog"."timestamp_ops" ASC NULLS LAST
  242. );
  243. -- ----------------------------
  244. -- Primary Key structure for table xxl_job_log_report
  245. -- ----------------------------
  246. ALTER TABLE "xxl_job_log_report" ADD CONSTRAINT "xxl_job_log_report_pkey" PRIMARY KEY ("id");
  247. -- ----------------------------
  248. -- Primary Key structure for table xxl_job_logglue
  249. -- ----------------------------
  250. ALTER TABLE "xxl_job_logglue" ADD CONSTRAINT "xxl_job_logglue_pkey" PRIMARY KEY ("id");
  251. -- ----------------------------
  252. -- Indexes structure for table xxl_job_registry
  253. -- ----------------------------
  254. CREATE INDEX "i_g_k_v" ON "xxl_job_registry" USING btree (
  255. "registry_group" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  256. "registry_key" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  257. "registry_value" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST
  258. );
  259. -- ----------------------------
  260. -- Primary Key structure for table xxl_job_registry
  261. -- ----------------------------
  262. ALTER TABLE "xxl_job_registry" ADD CONSTRAINT "xxl_job_registry_pkey" PRIMARY KEY ("id");
  263. -- ----------------------------
  264. -- Indexes structure for table xxl_job_user
  265. -- ----------------------------
  266. CREATE INDEX "i_username" ON "xxl_job_user" USING btree (
  267. "username" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST
  268. );
  269. -- ----------------------------
  270. -- Primary Key structure for table xxl_job_user
  271. -- ----------------------------
  272. ALTER TABLE "xxl_job_user" ADD CONSTRAINT "xxl_job_user_pkey" PRIMARY KEY ("id");