Нет описания

sqlserver.sql 19KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516
  1. -- 菜单
  2. CREATE TABLE sys_menu (
  3. menu_id bigint NOT NULL IDENTITY(1,1),
  4. parent_id bigint,
  5. name varchar(50),
  6. url varchar(200),
  7. perms varchar(500),
  8. type int,
  9. icon varchar(50),
  10. order_num int,
  11. PRIMARY KEY (menu_id)
  12. );
  13. -- 系统用户
  14. CREATE TABLE sys_user (
  15. user_id bigint NOT NULL IDENTITY(1,1),
  16. username varchar(50) NOT NULL,
  17. password varchar(100),
  18. salt varchar(20),
  19. email varchar(100),
  20. mobile varchar(100),
  21. status tinyint,
  22. create_user_id bigint,
  23. create_time datetime,
  24. PRIMARY KEY (user_id),
  25. UNIQUE (username)
  26. );
  27. -- 系统用户Token
  28. CREATE TABLE sys_user_token (
  29. user_id bigint NOT NULL,
  30. token varchar(100) NOT NULL,
  31. expire_time datetime,
  32. update_time datetime,
  33. PRIMARY KEY (user_id),
  34. UNIQUE (token)
  35. );
  36. -- 系统验证码
  37. CREATE TABLE sys_captcha (
  38. uuid varchar(36) NOT NULL,
  39. code varchar(6) NOT NULL,
  40. expire_time datetime,
  41. PRIMARY KEY (uuid)
  42. );
  43. -- 角色
  44. CREATE TABLE sys_role (
  45. role_id bigint NOT NULL IDENTITY(1,1),
  46. role_name varchar(100),
  47. remark varchar(100),
  48. create_user_id bigint,
  49. create_time datetime,
  50. PRIMARY KEY (role_id)
  51. );
  52. -- 用户与角色对应关系
  53. CREATE TABLE sys_user_role (
  54. id bigint NOT NULL IDENTITY(1,1),
  55. user_id bigint,
  56. role_id bigint,
  57. PRIMARY KEY (id)
  58. );
  59. -- 角色与菜单对应关系
  60. CREATE TABLE sys_role_menu (
  61. id bigint NOT NULL IDENTITY(1,1),
  62. role_id bigint,
  63. menu_id bigint,
  64. PRIMARY KEY (id)
  65. );
  66. -- 系统配置信息
  67. CREATE TABLE sys_config (
  68. id bigint NOT NULL IDENTITY(1,1),
  69. param_key varchar(50),
  70. param_value varchar(2000),
  71. status tinyint DEFAULT 1,
  72. remark varchar(500),
  73. PRIMARY KEY (id),
  74. UNIQUE (param_key)
  75. );
  76. -- 系统日志
  77. CREATE TABLE sys_log (
  78. id bigint NOT NULL IDENTITY(1,1),
  79. username varchar(50),
  80. operation varchar(50),
  81. method varchar(200),
  82. params varchar(5000),
  83. time bigint NOT NULL,
  84. ip varchar(64),
  85. create_date datetime,
  86. PRIMARY KEY (id)
  87. );
  88. -- 文件上传
  89. CREATE TABLE sys_oss (
  90. id bigint NOT NULL IDENTITY(1,1),
  91. url varchar(200),
  92. create_date datetime,
  93. PRIMARY KEY (id)
  94. );
  95. -- 定时任务
  96. CREATE TABLE schedule_job (
  97. job_id bigint NOT NULL IDENTITY(1,1),
  98. bean_name varchar(200),
  99. method_name varchar(100),
  100. params varchar(2000),
  101. cron_expression varchar(100),
  102. status tinyint,
  103. remark varchar(255),
  104. create_time datetime,
  105. PRIMARY KEY (job_id)
  106. );
  107. -- 定时任务日志
  108. CREATE TABLE schedule_job_log (
  109. log_id bigint NOT NULL IDENTITY(1,1),
  110. job_id bigint NOT NULL,
  111. bean_name varchar(200),
  112. method_name varchar(100),
  113. params varchar(2000),
  114. status tinyint NOT NULL,
  115. error varchar(2000),
  116. times int NOT NULL,
  117. create_time datetime,
  118. PRIMARY KEY (log_id),
  119. INDEX job_id (job_id)
  120. );
  121. -- 用户表
  122. CREATE TABLE tb_user (
  123. user_id bigint NOT NULL IDENTITY(1,1),
  124. username varchar(50) NOT NULL,
  125. mobile varchar(20) NOT NULL,
  126. password varchar(64),
  127. create_time datetime,
  128. PRIMARY KEY (user_id),
  129. UNIQUE (username)
  130. );
  131. SET IDENTITY_INSERT sys_user ON;
  132. 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');
  133. SET IDENTITY_INSERT sys_user OFF;
  134. SET IDENTITY_INSERT sys_menu ON;
  135. INSERT INTO sys_menu(menu_id, parent_id, name, url, perms, type, icon, order_num) VALUES (1, 0, '系统管理', NULL, NULL, 0, 'system', 0);
  136. INSERT INTO sys_menu(menu_id, parent_id, name, url, perms, type, icon, order_num) VALUES (2, 1, '管理员列表', 'sys/user', NULL, 1, 'admin', 1);
  137. INSERT INTO sys_menu(menu_id, parent_id, name, url, perms, type, icon, order_num) VALUES (3, 1, '角色管理', 'sys/role', NULL, 1, 'role', 2);
  138. INSERT INTO sys_menu(menu_id, parent_id, name, url, perms, type, icon, order_num) VALUES (4, 1, '菜单管理', 'sys/menu', NULL, 1, 'menu', 3);
  139. 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);
  140. INSERT INTO sys_menu(menu_id, parent_id, name, url, perms, type, icon, order_num) VALUES (6, 1, '定时任务', 'job/schedule', NULL, 1, 'job', 5);
  141. 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);
  142. 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);
  143. 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);
  144. 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);
  145. 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);
  146. 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);
  147. 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);
  148. 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);
  149. 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);
  150. 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);
  151. 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);
  152. 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);
  153. 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);
  154. 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);
  155. 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);
  156. 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);
  157. 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);
  158. 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);
  159. 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);
  160. 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);
  161. 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);
  162. 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);
  163. 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);
  164. SET IDENTITY_INSERT sys_menu OFF;
  165. 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://7xlij2.com1.z0.glb.clouddn.com","qiniuPrefix":"upload","qiniuSecretKey":"uIwJHevMRWU0VLxFvgy0tAcOdGqasdtVlJkdy6vV","type":1}', '0', '云存储配置信息');
  166. INSERT INTO schedule_job (bean_name, method_name, params, cron_expression, status, remark, create_time) VALUES ('testTask', 'test', 'renren', '0 0/30 * * * ?', '0', '有参数测试', '2016-12-01 23:16:46');
  167. INSERT INTO schedule_job (bean_name, method_name, params, cron_expression, status, remark, create_time) VALUES ('testTask', 'test2', NULL, '0 0/30 * * * ?', '1', '无参数测试', '2016-12-03 14:55:56');
  168. -- 账号:13612345678 密码:admin
  169. INSERT INTO tb_user (username, mobile, password, create_time) VALUES ('mark', '13612345678', '8c6976e5b5410415bde908bd4dee15dfb167a9c873fc4bb8a81f6f2ab448a918', '2017-03-23 22:37:41');
  170. -- quartz自带表结构
  171. IF EXISTS (SELECT * FROM dbo.sysobjects WHERE id = OBJECT_ID(N'[dbo].[FK_QRTZ_TRIGGERS_QRTZ_JOB_DETAILS]') AND OBJECTPROPERTY(id, N'ISFOREIGNKEY') = 1)
  172. ALTER TABLE [dbo].[QRTZ_TRIGGERS] DROP CONSTRAINT FK_QRTZ_TRIGGERS_QRTZ_JOB_DETAILS
  173. GO
  174. IF EXISTS (SELECT * FROM dbo.sysobjects WHERE id = OBJECT_ID(N'[dbo].[FK_QRTZ_CRON_TRIGGERS_QRTZ_TRIGGERS]') AND OBJECTPROPERTY(id, N'ISFOREIGNKEY') = 1)
  175. ALTER TABLE [dbo].[QRTZ_CRON_TRIGGERS] DROP CONSTRAINT FK_QRTZ_CRON_TRIGGERS_QRTZ_TRIGGERS
  176. GO
  177. IF EXISTS (SELECT * FROM dbo.sysobjects WHERE id = OBJECT_ID(N'[dbo].[FK_QRTZ_SIMPLE_TRIGGERS_QRTZ_TRIGGERS]') AND OBJECTPROPERTY(id, N'ISFOREIGNKEY') = 1)
  178. ALTER TABLE [dbo].[QRTZ_SIMPLE_TRIGGERS] DROP CONSTRAINT FK_QRTZ_SIMPLE_TRIGGERS_QRTZ_TRIGGERS
  179. GO
  180. IF EXISTS (SELECT * FROM dbo.sysobjects WHERE id = OBJECT_ID(N'[dbo].[FK_QRTZ_SIMPROP_TRIGGERS_QRTZ_TRIGGERS]') AND OBJECTPROPERTY(id, N'ISFOREIGNKEY') = 1)
  181. ALTER TABLE [dbo].[QRTZ_SIMPROP_TRIGGERS] DROP CONSTRAINT FK_QRTZ_SIMPROP_TRIGGERS_QRTZ_TRIGGERS
  182. GO
  183. IF EXISTS (SELECT * FROM dbo.sysobjects WHERE id = OBJECT_ID(N'[dbo].[QRTZ_CALENDARS]') AND OBJECTPROPERTY(id, N'ISUSERTABLE') = 1)
  184. DROP TABLE [dbo].[QRTZ_CALENDARS]
  185. GO
  186. IF EXISTS (SELECT * FROM dbo.sysobjects WHERE id = OBJECT_ID(N'[dbo].[QRTZ_CRON_TRIGGERS]') AND OBJECTPROPERTY(id, N'ISUSERTABLE') = 1)
  187. DROP TABLE [dbo].[QRTZ_CRON_TRIGGERS]
  188. GO
  189. IF EXISTS (SELECT * FROM dbo.sysobjects WHERE id = OBJECT_ID(N'[dbo].[QRTZ_BLOB_TRIGGERS]') AND OBJECTPROPERTY(id, N'ISUSERTABLE') = 1)
  190. DROP TABLE [dbo].[QRTZ_BLOB_TRIGGERS]
  191. GO
  192. IF EXISTS (SELECT * FROM dbo.sysobjects WHERE id = OBJECT_ID(N'[dbo].[QRTZ_FIRED_TRIGGERS]') AND OBJECTPROPERTY(id, N'ISUSERTABLE') = 1)
  193. DROP TABLE [dbo].[QRTZ_FIRED_TRIGGERS]
  194. GO
  195. IF EXISTS (SELECT * FROM dbo.sysobjects WHERE id = OBJECT_ID(N'[dbo].[QRTZ_PAUSED_TRIGGER_GRPS]') AND OBJECTPROPERTY(id, N'ISUSERTABLE') = 1)
  196. DROP TABLE [dbo].[QRTZ_PAUSED_TRIGGER_GRPS]
  197. GO
  198. IF EXISTS (SELECT * FROM dbo.sysobjects WHERE id = OBJECT_ID(N'[dbo].[QRTZ_SCHEDULER_STATE]') AND OBJECTPROPERTY(id, N'ISUSERTABLE') = 1)
  199. DROP TABLE [dbo].[QRTZ_SCHEDULER_STATE]
  200. GO
  201. IF EXISTS (SELECT * FROM dbo.sysobjects WHERE id = OBJECT_ID(N'[dbo].[QRTZ_LOCKS]') AND OBJECTPROPERTY(id, N'ISUSERTABLE') = 1)
  202. DROP TABLE [dbo].[QRTZ_LOCKS]
  203. GO
  204. IF EXISTS (SELECT * FROM dbo.sysobjects WHERE id = OBJECT_ID(N'[dbo].[QRTZ_JOB_DETAILS]') AND OBJECTPROPERTY(id, N'ISUSERTABLE') = 1)
  205. DROP TABLE [dbo].[QRTZ_JOB_DETAILS]
  206. GO
  207. IF EXISTS (SELECT * FROM dbo.sysobjects WHERE id = OBJECT_ID(N'[dbo].[QRTZ_SIMPLE_TRIGGERS]') AND OBJECTPROPERTY(id, N'ISUSERTABLE') = 1)
  208. DROP TABLE [dbo].[QRTZ_SIMPLE_TRIGGERS]
  209. GO
  210. IF EXISTS (SELECT * FROM dbo.sysobjects WHERE id = OBJECT_ID(N'[dbo].[QRTZ_SIMPROP_TRIGGERS]') AND OBJECTPROPERTY(id, N'ISUSERTABLE') = 1)
  211. DROP TABLE [dbo].[QRTZ_SIMPROP_TRIGGERS]
  212. GO
  213. IF EXISTS (SELECT * FROM dbo.sysobjects WHERE id = OBJECT_ID(N'[dbo].[QRTZ_TRIGGERS]') AND OBJECTPROPERTY(id, N'ISUSERTABLE') = 1)
  214. DROP TABLE [dbo].[QRTZ_TRIGGERS]
  215. GO
  216. CREATE TABLE [dbo].[QRTZ_CALENDARS] (
  217. [SCHED_NAME] [VARCHAR] (120) NOT NULL ,
  218. [CALENDAR_NAME] [VARCHAR] (200) NOT NULL ,
  219. [CALENDAR] [IMAGE] NOT NULL
  220. ) ON [PRIMARY]
  221. GO
  222. CREATE TABLE [dbo].[QRTZ_CRON_TRIGGERS] (
  223. [SCHED_NAME] [VARCHAR] (120) NOT NULL ,
  224. [TRIGGER_NAME] [VARCHAR] (200) NOT NULL ,
  225. [TRIGGER_GROUP] [VARCHAR] (200) NOT NULL ,
  226. [CRON_EXPRESSION] [VARCHAR] (120) NOT NULL ,
  227. [TIME_ZONE_ID] [VARCHAR] (80)
  228. ) ON [PRIMARY]
  229. GO
  230. CREATE TABLE [dbo].[QRTZ_FIRED_TRIGGERS] (
  231. [SCHED_NAME] [VARCHAR] (120) NOT NULL ,
  232. [ENTRY_ID] [VARCHAR] (95) NOT NULL ,
  233. [TRIGGER_NAME] [VARCHAR] (200) NOT NULL ,
  234. [TRIGGER_GROUP] [VARCHAR] (200) NOT NULL ,
  235. [INSTANCE_NAME] [VARCHAR] (200) NOT NULL ,
  236. [FIRED_TIME] [BIGINT] NOT NULL ,
  237. [SCHED_TIME] [BIGINT] NOT NULL ,
  238. [PRIORITY] [INTEGER] NOT NULL ,
  239. [STATE] [VARCHAR] (16) NOT NULL,
  240. [JOB_NAME] [VARCHAR] (200) NULL ,
  241. [JOB_GROUP] [VARCHAR] (200) NULL ,
  242. [IS_NONCONCURRENT] [VARCHAR] (1) NULL ,
  243. [REQUESTS_RECOVERY] [VARCHAR] (1) NULL
  244. ) ON [PRIMARY]
  245. GO
  246. CREATE TABLE [dbo].[QRTZ_PAUSED_TRIGGER_GRPS] (
  247. [SCHED_NAME] [VARCHAR] (120) NOT NULL ,
  248. [TRIGGER_GROUP] [VARCHAR] (200) NOT NULL
  249. ) ON [PRIMARY]
  250. GO
  251. CREATE TABLE [dbo].[QRTZ_SCHEDULER_STATE] (
  252. [SCHED_NAME] [VARCHAR] (120) NOT NULL ,
  253. [INSTANCE_NAME] [VARCHAR] (200) NOT NULL ,
  254. [LAST_CHECKIN_TIME] [BIGINT] NOT NULL ,
  255. [CHECKIN_INTERVAL] [BIGINT] NOT NULL
  256. ) ON [PRIMARY]
  257. GO
  258. CREATE TABLE [dbo].[QRTZ_LOCKS] (
  259. [SCHED_NAME] [VARCHAR] (120) NOT NULL ,
  260. [LOCK_NAME] [VARCHAR] (40) NOT NULL
  261. ) ON [PRIMARY]
  262. GO
  263. CREATE TABLE [dbo].[QRTZ_JOB_DETAILS] (
  264. [SCHED_NAME] [VARCHAR] (120) NOT NULL ,
  265. [JOB_NAME] [VARCHAR] (200) NOT NULL ,
  266. [JOB_GROUP] [VARCHAR] (200) NOT NULL ,
  267. [DESCRIPTION] [VARCHAR] (250) NULL ,
  268. [JOB_CLASS_NAME] [VARCHAR] (250) NOT NULL ,
  269. [IS_DURABLE] [VARCHAR] (1) NOT NULL ,
  270. [IS_NONCONCURRENT] [VARCHAR] (1) NOT NULL ,
  271. [IS_UPDATE_DATA] [VARCHAR] (1) NOT NULL ,
  272. [REQUESTS_RECOVERY] [VARCHAR] (1) NOT NULL ,
  273. [JOB_DATA] [IMAGE] NULL
  274. ) ON [PRIMARY]
  275. GO
  276. CREATE TABLE [dbo].[QRTZ_SIMPLE_TRIGGERS] (
  277. [SCHED_NAME] [VARCHAR] (120) NOT NULL ,
  278. [TRIGGER_NAME] [VARCHAR] (200) NOT NULL ,
  279. [TRIGGER_GROUP] [VARCHAR] (200) NOT NULL ,
  280. [REPEAT_COUNT] [BIGINT] NOT NULL ,
  281. [REPEAT_INTERVAL] [BIGINT] NOT NULL ,
  282. [TIMES_TRIGGERED] [BIGINT] NOT NULL
  283. ) ON [PRIMARY]
  284. GO
  285. CREATE TABLE [dbo].[QRTZ_SIMPROP_TRIGGERS] (
  286. [SCHED_NAME] [VARCHAR] (120) NOT NULL ,
  287. [TRIGGER_NAME] [VARCHAR] (200) NOT NULL ,
  288. [TRIGGER_GROUP] [VARCHAR] (200) NOT NULL ,
  289. [STR_PROP_1] [VARCHAR] (512) NULL,
  290. [STR_PROP_2] [VARCHAR] (512) NULL,
  291. [STR_PROP_3] [VARCHAR] (512) NULL,
  292. [INT_PROP_1] [INT] NULL,
  293. [INT_PROP_2] [INT] NULL,
  294. [LONG_PROP_1] [BIGINT] NULL,
  295. [LONG_PROP_2] [BIGINT] NULL,
  296. [DEC_PROP_1] [NUMERIC] (13,4) NULL,
  297. [DEC_PROP_2] [NUMERIC] (13,4) NULL,
  298. [BOOL_PROP_1] [VARCHAR] (1) NULL,
  299. [BOOL_PROP_2] [VARCHAR] (1) NULL,
  300. ) ON [PRIMARY]
  301. GO
  302. CREATE TABLE [dbo].[QRTZ_BLOB_TRIGGERS] (
  303. [SCHED_NAME] [VARCHAR] (120) NOT NULL ,
  304. [TRIGGER_NAME] [VARCHAR] (200) NOT NULL ,
  305. [TRIGGER_GROUP] [VARCHAR] (200) NOT NULL ,
  306. [BLOB_DATA] [IMAGE] NULL
  307. ) ON [PRIMARY]
  308. GO
  309. CREATE TABLE [dbo].[QRTZ_TRIGGERS] (
  310. [SCHED_NAME] [VARCHAR] (120) NOT NULL ,
  311. [TRIGGER_NAME] [VARCHAR] (200) NOT NULL ,
  312. [TRIGGER_GROUP] [VARCHAR] (200) NOT NULL ,
  313. [JOB_NAME] [VARCHAR] (200) NOT NULL ,
  314. [JOB_GROUP] [VARCHAR] (200) NOT NULL ,
  315. [DESCRIPTION] [VARCHAR] (250) NULL ,
  316. [NEXT_FIRE_TIME] [BIGINT] NULL ,
  317. [PREV_FIRE_TIME] [BIGINT] NULL ,
  318. [PRIORITY] [INTEGER] NULL ,
  319. [TRIGGER_STATE] [VARCHAR] (16) NOT NULL ,
  320. [TRIGGER_TYPE] [VARCHAR] (8) NOT NULL ,
  321. [START_TIME] [BIGINT] NOT NULL ,
  322. [END_TIME] [BIGINT] NULL ,
  323. [CALENDAR_NAME] [VARCHAR] (200) NULL ,
  324. [MISFIRE_INSTR] [SMALLINT] NULL ,
  325. [JOB_DATA] [IMAGE] NULL
  326. ) ON [PRIMARY]
  327. GO
  328. ALTER TABLE [dbo].[QRTZ_CALENDARS] WITH NOCHECK ADD
  329. CONSTRAINT [PK_QRTZ_CALENDARS] PRIMARY KEY CLUSTERED
  330. (
  331. [SCHED_NAME],
  332. [CALENDAR_NAME]
  333. ) ON [PRIMARY]
  334. GO
  335. ALTER TABLE [dbo].[QRTZ_CRON_TRIGGERS] WITH NOCHECK ADD
  336. CONSTRAINT [PK_QRTZ_CRON_TRIGGERS] PRIMARY KEY CLUSTERED
  337. (
  338. [SCHED_NAME],
  339. [TRIGGER_NAME],
  340. [TRIGGER_GROUP]
  341. ) ON [PRIMARY]
  342. GO
  343. ALTER TABLE [dbo].[QRTZ_FIRED_TRIGGERS] WITH NOCHECK ADD
  344. CONSTRAINT [PK_QRTZ_FIRED_TRIGGERS] PRIMARY KEY CLUSTERED
  345. (
  346. [SCHED_NAME],
  347. [ENTRY_ID]
  348. ) ON [PRIMARY]
  349. GO
  350. ALTER TABLE [dbo].[QRTZ_PAUSED_TRIGGER_GRPS] WITH NOCHECK ADD
  351. CONSTRAINT [PK_QRTZ_PAUSED_TRIGGER_GRPS] PRIMARY KEY CLUSTERED
  352. (
  353. [SCHED_NAME],
  354. [TRIGGER_GROUP]
  355. ) ON [PRIMARY]
  356. GO
  357. ALTER TABLE [dbo].[QRTZ_SCHEDULER_STATE] WITH NOCHECK ADD
  358. CONSTRAINT [PK_QRTZ_SCHEDULER_STATE] PRIMARY KEY CLUSTERED
  359. (
  360. [SCHED_NAME],
  361. [INSTANCE_NAME]
  362. ) ON [PRIMARY]
  363. GO
  364. ALTER TABLE [dbo].[QRTZ_LOCKS] WITH NOCHECK ADD
  365. CONSTRAINT [PK_QRTZ_LOCKS] PRIMARY KEY CLUSTERED
  366. (
  367. [SCHED_NAME],
  368. [LOCK_NAME]
  369. ) ON [PRIMARY]
  370. GO
  371. ALTER TABLE [dbo].[QRTZ_JOB_DETAILS] WITH NOCHECK ADD
  372. CONSTRAINT [PK_QRTZ_JOB_DETAILS] PRIMARY KEY CLUSTERED
  373. (
  374. [SCHED_NAME],
  375. [JOB_NAME],
  376. [JOB_GROUP]
  377. ) ON [PRIMARY]
  378. GO
  379. ALTER TABLE [dbo].[QRTZ_SIMPLE_TRIGGERS] WITH NOCHECK ADD
  380. CONSTRAINT [PK_QRTZ_SIMPLE_TRIGGERS] PRIMARY KEY CLUSTERED
  381. (
  382. [SCHED_NAME],
  383. [TRIGGER_NAME],
  384. [TRIGGER_GROUP]
  385. ) ON [PRIMARY]
  386. GO
  387. ALTER TABLE [dbo].[QRTZ_SIMPROP_TRIGGERS] WITH NOCHECK ADD
  388. CONSTRAINT [PK_QRTZ_SIMPROP_TRIGGERS] PRIMARY KEY CLUSTERED
  389. (
  390. [SCHED_NAME],
  391. [TRIGGER_NAME],
  392. [TRIGGER_GROUP]
  393. ) ON [PRIMARY]
  394. GO
  395. ALTER TABLE [dbo].[QRTZ_TRIGGERS] WITH NOCHECK ADD
  396. CONSTRAINT [PK_QRTZ_TRIGGERS] PRIMARY KEY CLUSTERED
  397. (
  398. [SCHED_NAME],
  399. [TRIGGER_NAME],
  400. [TRIGGER_GROUP]
  401. ) ON [PRIMARY]
  402. GO
  403. ALTER TABLE [dbo].[QRTZ_CRON_TRIGGERS] ADD
  404. CONSTRAINT [FK_QRTZ_CRON_TRIGGERS_QRTZ_TRIGGERS] FOREIGN KEY
  405. (
  406. [SCHED_NAME],
  407. [TRIGGER_NAME],
  408. [TRIGGER_GROUP]
  409. ) REFERENCES [dbo].[QRTZ_TRIGGERS] (
  410. [SCHED_NAME],
  411. [TRIGGER_NAME],
  412. [TRIGGER_GROUP]
  413. ) ON DELETE CASCADE
  414. GO
  415. ALTER TABLE [dbo].[QRTZ_SIMPLE_TRIGGERS] ADD
  416. CONSTRAINT [FK_QRTZ_SIMPLE_TRIGGERS_QRTZ_TRIGGERS] FOREIGN KEY
  417. (
  418. [SCHED_NAME],
  419. [TRIGGER_NAME],
  420. [TRIGGER_GROUP]
  421. ) REFERENCES [dbo].[QRTZ_TRIGGERS] (
  422. [SCHED_NAME],
  423. [TRIGGER_NAME],
  424. [TRIGGER_GROUP]
  425. ) ON DELETE CASCADE
  426. GO
  427. ALTER TABLE [dbo].[QRTZ_SIMPROP_TRIGGERS] ADD
  428. CONSTRAINT [FK_QRTZ_SIMPROP_TRIGGERS_QRTZ_TRIGGERS] FOREIGN KEY
  429. (
  430. [SCHED_NAME],
  431. [TRIGGER_NAME],
  432. [TRIGGER_GROUP]
  433. ) REFERENCES [dbo].[QRTZ_TRIGGERS] (
  434. [SCHED_NAME],
  435. [TRIGGER_NAME],
  436. [TRIGGER_GROUP]
  437. ) ON DELETE CASCADE
  438. GO
  439. ALTER TABLE [dbo].[QRTZ_TRIGGERS] ADD
  440. CONSTRAINT [FK_QRTZ_TRIGGERS_QRTZ_JOB_DETAILS] FOREIGN KEY
  441. (
  442. [SCHED_NAME],
  443. [JOB_NAME],
  444. [JOB_GROUP]
  445. ) REFERENCES [dbo].[QRTZ_JOB_DETAILS] (
  446. [SCHED_NAME],
  447. [JOB_NAME],
  448. [JOB_GROUP]
  449. )
  450. GO