mysql.sql 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356
  1. -- 菜单
  2. CREATE TABLE `sys_menu` (
  3. `menu_id` bigint NOT NULL AUTO_INCREMENT,
  4. `parent_id` bigint COMMENT '父菜单ID,一级菜单为0',
  5. `name` varchar(50) COMMENT '菜单名称',
  6. `url` varchar(200) COMMENT '菜单URL',
  7. `perms` varchar(500) COMMENT '授权(多个用逗号分隔,如:user:list,user:create)',
  8. `type` int COMMENT '类型 0:目录 1:菜单 2:按钮',
  9. `icon` varchar(50) COMMENT '菜单图标',
  10. `order_num` int COMMENT '排序',
  11. PRIMARY KEY (`menu_id`)
  12. ) ENGINE=`InnoDB` DEFAULT CHARACTER SET utf8mb4 COMMENT='菜单管理';
  13. -- 系统用户
  14. CREATE TABLE `sys_user` (
  15. `user_id` bigint NOT NULL AUTO_INCREMENT,
  16. `username` varchar(50) NOT NULL COMMENT '用户名',
  17. `password` varchar(100) COMMENT '密码',
  18. `salt` varchar(20) COMMENT '盐',
  19. `email` varchar(100) COMMENT '邮箱',
  20. `mobile` varchar(100) COMMENT '手机号',
  21. `status` tinyint COMMENT '状态 0:禁用 1:正常',
  22. `create_user_id` bigint(20) COMMENT '创建者ID',
  23. `create_time` datetime COMMENT '创建时间',
  24. PRIMARY KEY (`user_id`),
  25. UNIQUE INDEX (`username`)
  26. ) ENGINE=`InnoDB` DEFAULT CHARACTER SET utf8mb4 COMMENT='系统用户';
  27. -- 系统用户Token
  28. CREATE TABLE `sys_user_token` (
  29. `user_id` bigint(20) NOT NULL,
  30. `token` varchar(100) NOT NULL COMMENT 'token',
  31. `expire_time` datetime DEFAULT NULL COMMENT '过期时间',
  32. `update_time` datetime DEFAULT NULL COMMENT '更新时间',
  33. PRIMARY KEY (`user_id`),
  34. UNIQUE KEY `token` (`token`)
  35. ) ENGINE=`InnoDB` DEFAULT CHARACTER SET utf8mb4 COMMENT='系统用户Token';
  36. -- 系统验证码
  37. CREATE TABLE `sys_captcha` (
  38. `uuid` char(36) NOT NULL COMMENT 'uuid',
  39. `code` varchar(6) NOT NULL COMMENT '验证码',
  40. `expire_time` datetime DEFAULT NULL COMMENT '过期时间',
  41. PRIMARY KEY (`uuid`)
  42. ) ENGINE=`InnoDB` DEFAULT CHARACTER SET utf8mb4 COMMENT='系统验证码';
  43. -- 角色
  44. CREATE TABLE `sys_role` (
  45. `role_id` bigint NOT NULL AUTO_INCREMENT,
  46. `role_name` varchar(100) COMMENT '角色名称',
  47. `remark` varchar(100) COMMENT '备注',
  48. `create_user_id` bigint(20) COMMENT '创建者ID',
  49. `create_time` datetime COMMENT '创建时间',
  50. PRIMARY KEY (`role_id`)
  51. ) ENGINE=`InnoDB` DEFAULT CHARACTER SET utf8mb4 COMMENT='角色';
  52. -- 用户与角色对应关系
  53. CREATE TABLE `sys_user_role` (
  54. `id` bigint NOT NULL AUTO_INCREMENT,
  55. `user_id` bigint COMMENT '用户ID',
  56. `role_id` bigint COMMENT '角色ID',
  57. PRIMARY KEY (`id`)
  58. ) ENGINE=`InnoDB` DEFAULT CHARACTER SET utf8mb4 COMMENT='用户与角色对应关系';
  59. -- 角色与菜单对应关系
  60. CREATE TABLE `sys_role_menu` (
  61. `id` bigint NOT NULL AUTO_INCREMENT,
  62. `role_id` bigint COMMENT '角色ID',
  63. `menu_id` bigint COMMENT '菜单ID',
  64. PRIMARY KEY (`id`)
  65. ) ENGINE=`InnoDB` DEFAULT CHARACTER SET utf8mb4 COMMENT='角色与菜单对应关系';
  66. -- 系统配置信息
  67. CREATE TABLE `sys_config` (
  68. `id` bigint NOT NULL AUTO_INCREMENT,
  69. `param_key` varchar(50) COMMENT 'key',
  70. `param_value` varchar(2000) COMMENT 'value',
  71. `status` tinyint DEFAULT 1 COMMENT '状态 0:隐藏 1:显示',
  72. `remark` varchar(500) COMMENT '备注',
  73. PRIMARY KEY (`id`),
  74. UNIQUE INDEX (`param_key`)
  75. ) ENGINE=`InnoDB` DEFAULT CHARACTER SET utf8mb4 COMMENT='系统配置信息表';
  76. -- 系统日志
  77. CREATE TABLE `sys_log` (
  78. `id` bigint(20) NOT NULL AUTO_INCREMENT,
  79. `username` varchar(50) COMMENT '用户名',
  80. `operation` varchar(50) COMMENT '用户操作',
  81. `method` varchar(200) COMMENT '请求方法',
  82. `params` varchar(5000) COMMENT '请求参数',
  83. `time` bigint NOT NULL COMMENT '执行时长(毫秒)',
  84. `ip` varchar(64) COMMENT 'IP地址',
  85. `create_date` datetime COMMENT '创建时间',
  86. PRIMARY KEY (`id`)
  87. ) ENGINE=`InnoDB` DEFAULT CHARACTER SET utf8mb4 COMMENT='系统日志';
  88. -- 文件上传
  89. CREATE TABLE `sys_oss` (
  90. `id` bigint(20) NOT NULL AUTO_INCREMENT,
  91. `url` varchar(200) COMMENT 'URL地址',
  92. `create_date` datetime COMMENT '创建时间',
  93. PRIMARY KEY (`id`)
  94. ) ENGINE=`InnoDB` DEFAULT CHARACTER SET utf8mb4 COMMENT='文件上传';
  95. -- 定时任务
  96. CREATE TABLE `schedule_job` (
  97. `job_id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '任务id',
  98. `bean_name` varchar(200) DEFAULT NULL COMMENT 'spring bean名称',
  99. `params` varchar(2000) DEFAULT NULL COMMENT '参数',
  100. `cron_expression` varchar(100) DEFAULT NULL COMMENT 'cron表达式',
  101. `status` tinyint(4) DEFAULT NULL COMMENT '任务状态 0:正常 1:暂停',
  102. `remark` varchar(255) DEFAULT NULL COMMENT '备注',
  103. `create_time` datetime DEFAULT NULL COMMENT '创建时间',
  104. PRIMARY KEY (`job_id`)
  105. ) ENGINE=`InnoDB` DEFAULT CHARACTER SET utf8mb4 COMMENT='定时任务';
  106. -- 定时任务日志
  107. CREATE TABLE `schedule_job_log` (
  108. `log_id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '任务日志id',
  109. `job_id` bigint(20) NOT NULL COMMENT '任务id',
  110. `bean_name` varchar(200) DEFAULT NULL COMMENT 'spring bean名称',
  111. `params` varchar(2000) DEFAULT NULL COMMENT '参数',
  112. `status` tinyint(4) NOT NULL COMMENT '任务状态 0:成功 1:失败',
  113. `error` varchar(2000) DEFAULT NULL COMMENT '失败信息',
  114. `times` int(11) NOT NULL COMMENT '耗时(单位:毫秒)',
  115. `create_time` datetime DEFAULT NULL COMMENT '创建时间',
  116. PRIMARY KEY (`log_id`),
  117. KEY `job_id` (`job_id`)
  118. ) ENGINE=`InnoDB` DEFAULT CHARACTER SET utf8mb4 COMMENT='定时任务日志';
  119. -- 用户表
  120. CREATE TABLE `tb_user` (
  121. `user_id` bigint NOT NULL AUTO_INCREMENT,
  122. `username` varchar(50) NOT NULL COMMENT '用户名',
  123. `mobile` varchar(20) NOT NULL COMMENT '手机号',
  124. `password` varchar(64) COMMENT '密码',
  125. `create_time` datetime COMMENT '创建时间',
  126. PRIMARY KEY (`user_id`),
  127. UNIQUE INDEX (`username`)
  128. ) ENGINE=`InnoDB` DEFAULT CHARACTER SET utf8mb4 COMMENT='用户';
  129. -- 初始数据
  130. INSERT INTO `sys_user` (`user_id`, `username`, `password`, `salt`, `email`, `mobile`, `status`, `create_user_id`, `create_time`) VALUES ('1', 'admin', '9ec9750e709431dad22365cabc5c625482e574c74adaebba7dd02f1129e4ce1d', 'YzcmCZNvbXocrsz9dm8e', 'root@renren.io', '13612345678', '1', '1', '2016-11-11 11:11:11');
  131. INSERT INTO `sys_menu`(`menu_id`, `parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`) VALUES (1, 0, '系统管理', NULL, NULL, 0, 'system', 0);
  132. INSERT INTO `sys_menu`(`menu_id`, `parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`) VALUES (2, 1, '管理员列表', 'sys/user', NULL, 1, 'admin', 1);
  133. INSERT INTO `sys_menu`(`menu_id`, `parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`) VALUES (3, 1, '角色管理', 'sys/role', NULL, 1, 'role', 2);
  134. INSERT INTO `sys_menu`(`menu_id`, `parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`) VALUES (4, 1, '菜单管理', 'sys/menu', NULL, 1, 'menu', 3);
  135. INSERT INTO `sys_menu`(`menu_id`, `parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`) VALUES (5, 1, 'SQL监控', 'http://localhost:8080/renren-fast/druid/sql.html', NULL, 1, 'sql', 4);
  136. INSERT INTO `sys_menu`(`menu_id`, `parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`) VALUES (6, 1, '定时任务', 'job/schedule', NULL, 1, 'job', 5);
  137. INSERT INTO `sys_menu`(`menu_id`, `parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`) VALUES (7, 6, '查看', NULL, 'sys:schedule:list,sys:schedule:info', 2, NULL, 0);
  138. INSERT INTO `sys_menu`(`menu_id`, `parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`) VALUES (8, 6, '新增', NULL, 'sys:schedule:save', 2, NULL, 0);
  139. INSERT INTO `sys_menu`(`menu_id`, `parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`) VALUES (9, 6, '修改', NULL, 'sys:schedule:update', 2, NULL, 0);
  140. INSERT INTO `sys_menu`(`menu_id`, `parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`) VALUES (10, 6, '删除', NULL, 'sys:schedule:delete', 2, NULL, 0);
  141. INSERT INTO `sys_menu`(`menu_id`, `parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`) VALUES (11, 6, '暂停', NULL, 'sys:schedule:pause', 2, NULL, 0);
  142. INSERT INTO `sys_menu`(`menu_id`, `parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`) VALUES (12, 6, '恢复', NULL, 'sys:schedule:resume', 2, NULL, 0);
  143. INSERT INTO `sys_menu`(`menu_id`, `parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`) VALUES (13, 6, '立即执行', NULL, 'sys:schedule:run', 2, NULL, 0);
  144. INSERT INTO `sys_menu`(`menu_id`, `parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`) VALUES (14, 6, '日志列表', NULL, 'sys:schedule:log', 2, NULL, 0);
  145. INSERT INTO `sys_menu`(`menu_id`, `parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`) VALUES (15, 2, '查看', NULL, 'sys:user:list,sys:user:info', 2, NULL, 0);
  146. INSERT INTO `sys_menu`(`menu_id`, `parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`) VALUES (16, 2, '新增', NULL, 'sys:user:save,sys:role:select', 2, NULL, 0);
  147. INSERT INTO `sys_menu`(`menu_id`, `parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`) VALUES (17, 2, '修改', NULL, 'sys:user:update,sys:role:select', 2, NULL, 0);
  148. INSERT INTO `sys_menu`(`menu_id`, `parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`) VALUES (18, 2, '删除', NULL, 'sys:user:delete', 2, NULL, 0);
  149. INSERT INTO `sys_menu`(`menu_id`, `parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`) VALUES (19, 3, '查看', NULL, 'sys:role:list,sys:role:info', 2, NULL, 0);
  150. INSERT INTO `sys_menu`(`menu_id`, `parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`) VALUES (20, 3, '新增', NULL, 'sys:role:save,sys:menu:list', 2, NULL, 0);
  151. INSERT INTO `sys_menu`(`menu_id`, `parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`) VALUES (21, 3, '修改', NULL, 'sys:role:update,sys:menu:list', 2, NULL, 0);
  152. INSERT INTO `sys_menu`(`menu_id`, `parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`) VALUES (22, 3, '删除', NULL, 'sys:role:delete', 2, NULL, 0);
  153. INSERT INTO `sys_menu`(`menu_id`, `parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`) VALUES (23, 4, '查看', NULL, 'sys:menu:list,sys:menu:info', 2, NULL, 0);
  154. INSERT INTO `sys_menu`(`menu_id`, `parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`) VALUES (24, 4, '新增', NULL, 'sys:menu:save,sys:menu:select', 2, NULL, 0);
  155. INSERT INTO `sys_menu`(`menu_id`, `parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`) VALUES (25, 4, '修改', NULL, 'sys:menu:update,sys:menu:select', 2, NULL, 0);
  156. INSERT INTO `sys_menu`(`menu_id`, `parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`) VALUES (26, 4, '删除', NULL, 'sys:menu:delete', 2, NULL, 0);
  157. INSERT INTO `sys_menu`(`menu_id`, `parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`) VALUES (27, 1, '参数管理', 'sys/config', 'sys:config:list,sys:config:info,sys:config:save,sys:config:update,sys:config:delete', 1, 'config', 6);
  158. INSERT INTO `sys_menu`(`menu_id`, `parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`) VALUES (29, 1, '系统日志', 'sys/log', 'sys:log:list', 1, 'log', 7);
  159. INSERT INTO `sys_menu`(`menu_id`, `parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`) VALUES (30, 1, '文件上传', 'oss/oss', 'sys:oss:all', 1, 'oss', 6);
  160. INSERT INTO `sys_config` (`param_key`, `param_value`, `status`, `remark`) VALUES ('CLOUD_STORAGE_CONFIG_KEY', '{\"aliyunAccessKeyId\":\"\",\"aliyunAccessKeySecret\":\"\",\"aliyunBucketName\":\"\",\"aliyunDomain\":\"\",\"aliyunEndPoint\":\"\",\"aliyunPrefix\":\"\",\"qcloudBucketName\":\"\",\"qcloudDomain\":\"\",\"qcloudPrefix\":\"\",\"qcloudSecretId\":\"\",\"qcloudSecretKey\":\"\",\"qiniuAccessKey\":\"NrgMfABZxWLo5B-YYSjoE8-AZ1EISdi1Z3ubLOeZ\",\"qiniuBucketName\":\"ios-app\",\"qiniuDomain\":\"http://7xqbwh.dl1.z0.glb.clouddn.com\",\"qiniuPrefix\":\"upload\",\"qiniuSecretKey\":\"uIwJHevMRWU0VLxFvgy0tAcOdGqasdtVlJkdy6vV\",\"type\":1}', '0', '云存储配置信息');
  161. INSERT INTO `schedule_job` (`bean_name`, `params`, `cron_expression`, `status`, `remark`, `create_time`) VALUES ('testTask', 'renren', '0 0/30 * * * ?', '0', '参数测试', now());
  162. -- 账号:13612345678 密码:admin
  163. INSERT INTO `tb_user` (`username`, `mobile`, `password`, `create_time`) VALUES ('mark', '13612345678', '8c6976e5b5410415bde908bd4dee15dfb167a9c873fc4bb8a81f6f2ab448a918', '2017-03-23 22:37:41');
  164. -- quartz自带表结构
  165. CREATE TABLE QRTZ_JOB_DETAILS(
  166. SCHED_NAME VARCHAR(120) NOT NULL,
  167. JOB_NAME VARCHAR(200) NOT NULL,
  168. JOB_GROUP VARCHAR(200) NOT NULL,
  169. DESCRIPTION VARCHAR(250) NULL,
  170. JOB_CLASS_NAME VARCHAR(250) NOT NULL,
  171. IS_DURABLE VARCHAR(1) NOT NULL,
  172. IS_NONCONCURRENT VARCHAR(1) NOT NULL,
  173. IS_UPDATE_DATA VARCHAR(1) NOT NULL,
  174. REQUESTS_RECOVERY VARCHAR(1) NOT NULL,
  175. JOB_DATA BLOB NULL,
  176. PRIMARY KEY (SCHED_NAME,JOB_NAME,JOB_GROUP))
  177. ENGINE=InnoDB DEFAULT CHARSET=utf8;
  178. CREATE TABLE QRTZ_TRIGGERS (
  179. SCHED_NAME VARCHAR(120) NOT NULL,
  180. TRIGGER_NAME VARCHAR(200) NOT NULL,
  181. TRIGGER_GROUP VARCHAR(200) NOT NULL,
  182. JOB_NAME VARCHAR(200) NOT NULL,
  183. JOB_GROUP VARCHAR(200) NOT NULL,
  184. DESCRIPTION VARCHAR(250) NULL,
  185. NEXT_FIRE_TIME BIGINT(13) NULL,
  186. PREV_FIRE_TIME BIGINT(13) NULL,
  187. PRIORITY INTEGER NULL,
  188. TRIGGER_STATE VARCHAR(16) NOT NULL,
  189. TRIGGER_TYPE VARCHAR(8) NOT NULL,
  190. START_TIME BIGINT(13) NOT NULL,
  191. END_TIME BIGINT(13) NULL,
  192. CALENDAR_NAME VARCHAR(200) NULL,
  193. MISFIRE_INSTR SMALLINT(2) NULL,
  194. JOB_DATA BLOB NULL,
  195. PRIMARY KEY (SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP),
  196. FOREIGN KEY (SCHED_NAME,JOB_NAME,JOB_GROUP)
  197. REFERENCES QRTZ_JOB_DETAILS(SCHED_NAME,JOB_NAME,JOB_GROUP))
  198. ENGINE=InnoDB DEFAULT CHARSET=utf8;
  199. CREATE TABLE QRTZ_SIMPLE_TRIGGERS (
  200. SCHED_NAME VARCHAR(120) NOT NULL,
  201. TRIGGER_NAME VARCHAR(200) NOT NULL,
  202. TRIGGER_GROUP VARCHAR(200) NOT NULL,
  203. REPEAT_COUNT BIGINT(7) NOT NULL,
  204. REPEAT_INTERVAL BIGINT(12) NOT NULL,
  205. TIMES_TRIGGERED BIGINT(10) NOT NULL,
  206. PRIMARY KEY (SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP),
  207. FOREIGN KEY (SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP)
  208. REFERENCES QRTZ_TRIGGERS(SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP))
  209. ENGINE=InnoDB DEFAULT CHARSET=utf8;
  210. CREATE TABLE QRTZ_CRON_TRIGGERS (
  211. SCHED_NAME VARCHAR(120) NOT NULL,
  212. TRIGGER_NAME VARCHAR(200) NOT NULL,
  213. TRIGGER_GROUP VARCHAR(200) NOT NULL,
  214. CRON_EXPRESSION VARCHAR(120) NOT NULL,
  215. TIME_ZONE_ID VARCHAR(80),
  216. PRIMARY KEY (SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP),
  217. FOREIGN KEY (SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP)
  218. REFERENCES QRTZ_TRIGGERS(SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP))
  219. ENGINE=InnoDB DEFAULT CHARSET=utf8;
  220. CREATE TABLE QRTZ_SIMPROP_TRIGGERS
  221. (
  222. SCHED_NAME VARCHAR(120) NOT NULL,
  223. TRIGGER_NAME VARCHAR(200) NOT NULL,
  224. TRIGGER_GROUP VARCHAR(200) NOT NULL,
  225. STR_PROP_1 VARCHAR(512) NULL,
  226. STR_PROP_2 VARCHAR(512) NULL,
  227. STR_PROP_3 VARCHAR(512) NULL,
  228. INT_PROP_1 INT NULL,
  229. INT_PROP_2 INT NULL,
  230. LONG_PROP_1 BIGINT NULL,
  231. LONG_PROP_2 BIGINT NULL,
  232. DEC_PROP_1 NUMERIC(13,4) NULL,
  233. DEC_PROP_2 NUMERIC(13,4) NULL,
  234. BOOL_PROP_1 VARCHAR(1) NULL,
  235. BOOL_PROP_2 VARCHAR(1) NULL,
  236. PRIMARY KEY (SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP),
  237. FOREIGN KEY (SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP)
  238. REFERENCES QRTZ_TRIGGERS(SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP))
  239. ENGINE=InnoDB DEFAULT CHARSET=utf8;
  240. CREATE TABLE QRTZ_BLOB_TRIGGERS (
  241. SCHED_NAME VARCHAR(120) NOT NULL,
  242. TRIGGER_NAME VARCHAR(200) NOT NULL,
  243. TRIGGER_GROUP VARCHAR(200) NOT NULL,
  244. BLOB_DATA BLOB NULL,
  245. PRIMARY KEY (SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP),
  246. INDEX (SCHED_NAME,TRIGGER_NAME, TRIGGER_GROUP),
  247. FOREIGN KEY (SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP)
  248. REFERENCES QRTZ_TRIGGERS(SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP))
  249. ENGINE=InnoDB DEFAULT CHARSET=utf8;
  250. CREATE TABLE QRTZ_CALENDARS (
  251. SCHED_NAME VARCHAR(120) NOT NULL,
  252. CALENDAR_NAME VARCHAR(200) NOT NULL,
  253. CALENDAR BLOB NOT NULL,
  254. PRIMARY KEY (SCHED_NAME,CALENDAR_NAME))
  255. ENGINE=InnoDB DEFAULT CHARSET=utf8;
  256. CREATE TABLE QRTZ_PAUSED_TRIGGER_GRPS (
  257. SCHED_NAME VARCHAR(120) NOT NULL,
  258. TRIGGER_GROUP VARCHAR(200) NOT NULL,
  259. PRIMARY KEY (SCHED_NAME,TRIGGER_GROUP))
  260. ENGINE=InnoDB DEFAULT CHARSET=utf8;
  261. CREATE TABLE QRTZ_FIRED_TRIGGERS (
  262. SCHED_NAME VARCHAR(120) NOT NULL,
  263. ENTRY_ID VARCHAR(95) NOT NULL,
  264. TRIGGER_NAME VARCHAR(200) NOT NULL,
  265. TRIGGER_GROUP VARCHAR(200) NOT NULL,
  266. INSTANCE_NAME VARCHAR(200) NOT NULL,
  267. FIRED_TIME BIGINT(13) NOT NULL,
  268. SCHED_TIME BIGINT(13) NOT NULL,
  269. PRIORITY INTEGER NOT NULL,
  270. STATE VARCHAR(16) NOT NULL,
  271. JOB_NAME VARCHAR(200) NULL,
  272. JOB_GROUP VARCHAR(200) NULL,
  273. IS_NONCONCURRENT VARCHAR(1) NULL,
  274. REQUESTS_RECOVERY VARCHAR(1) NULL,
  275. PRIMARY KEY (SCHED_NAME,ENTRY_ID))
  276. ENGINE=InnoDB DEFAULT CHARSET=utf8;
  277. CREATE TABLE QRTZ_SCHEDULER_STATE (
  278. SCHED_NAME VARCHAR(120) NOT NULL,
  279. INSTANCE_NAME VARCHAR(200) NOT NULL,
  280. LAST_CHECKIN_TIME BIGINT(13) NOT NULL,
  281. CHECKIN_INTERVAL BIGINT(13) NOT NULL,
  282. PRIMARY KEY (SCHED_NAME,INSTANCE_NAME))
  283. ENGINE=InnoDB DEFAULT CHARSET=utf8;
  284. CREATE TABLE QRTZ_LOCKS (
  285. SCHED_NAME VARCHAR(120) NOT NULL,
  286. LOCK_NAME VARCHAR(40) NOT NULL,
  287. PRIMARY KEY (SCHED_NAME,LOCK_NAME))
  288. ENGINE=InnoDB DEFAULT CHARSET=utf8;
  289. CREATE INDEX IDX_QRTZ_J_REQ_RECOVERY ON QRTZ_JOB_DETAILS(SCHED_NAME,REQUESTS_RECOVERY);
  290. CREATE INDEX IDX_QRTZ_J_GRP ON QRTZ_JOB_DETAILS(SCHED_NAME,JOB_GROUP);
  291. CREATE INDEX IDX_QRTZ_T_J ON QRTZ_TRIGGERS(SCHED_NAME,JOB_NAME,JOB_GROUP);
  292. CREATE INDEX IDX_QRTZ_T_JG ON QRTZ_TRIGGERS(SCHED_NAME,JOB_GROUP);
  293. CREATE INDEX IDX_QRTZ_T_C ON QRTZ_TRIGGERS(SCHED_NAME,CALENDAR_NAME);
  294. CREATE INDEX IDX_QRTZ_T_G ON QRTZ_TRIGGERS(SCHED_NAME,TRIGGER_GROUP);
  295. CREATE INDEX IDX_QRTZ_T_STATE ON QRTZ_TRIGGERS(SCHED_NAME,TRIGGER_STATE);
  296. CREATE INDEX IDX_QRTZ_T_N_STATE ON QRTZ_TRIGGERS(SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP,TRIGGER_STATE);
  297. CREATE INDEX IDX_QRTZ_T_N_G_STATE ON QRTZ_TRIGGERS(SCHED_NAME,TRIGGER_GROUP,TRIGGER_STATE);
  298. CREATE INDEX IDX_QRTZ_T_NEXT_FIRE_TIME ON QRTZ_TRIGGERS(SCHED_NAME,NEXT_FIRE_TIME);
  299. CREATE INDEX IDX_QRTZ_T_NFT_ST ON QRTZ_TRIGGERS(SCHED_NAME,TRIGGER_STATE,NEXT_FIRE_TIME);
  300. CREATE INDEX IDX_QRTZ_T_NFT_MISFIRE ON QRTZ_TRIGGERS(SCHED_NAME,MISFIRE_INSTR,NEXT_FIRE_TIME);
  301. CREATE INDEX IDX_QRTZ_T_NFT_ST_MISFIRE ON QRTZ_TRIGGERS(SCHED_NAME,MISFIRE_INSTR,NEXT_FIRE_TIME,TRIGGER_STATE);
  302. CREATE INDEX IDX_QRTZ_T_NFT_ST_MISFIRE_GRP ON QRTZ_TRIGGERS(SCHED_NAME,MISFIRE_INSTR,NEXT_FIRE_TIME,TRIGGER_GROUP,TRIGGER_STATE);
  303. CREATE INDEX IDX_QRTZ_FT_TRIG_INST_NAME ON QRTZ_FIRED_TRIGGERS(SCHED_NAME,INSTANCE_NAME);
  304. CREATE INDEX IDX_QRTZ_FT_INST_JOB_REQ_RCVRY ON QRTZ_FIRED_TRIGGERS(SCHED_NAME,INSTANCE_NAME,REQUESTS_RECOVERY);
  305. CREATE INDEX IDX_QRTZ_FT_J_G ON QRTZ_FIRED_TRIGGERS(SCHED_NAME,JOB_NAME,JOB_GROUP);
  306. CREATE INDEX IDX_QRTZ_FT_JG ON QRTZ_FIRED_TRIGGERS(SCHED_NAME,JOB_GROUP);
  307. CREATE INDEX IDX_QRTZ_FT_T_G ON QRTZ_FIRED_TRIGGERS(SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP);
  308. CREATE INDEX IDX_QRTZ_FT_TG ON QRTZ_FIRED_TRIGGERS(SCHED_NAME,TRIGGER_GROUP);