sqlserver.sql 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765
  1. -- 菜单
  2. CREATE TABLE sys_menu
  3. (
  4. menu_id bigint NOT NULL IDENTITY(1,1),
  5. parent_id bigint,
  6. name varchar(50),
  7. url varchar(200),
  8. perms varchar(500),
  9. type int,
  10. icon varchar(50),
  11. order_num int,
  12. PRIMARY KEY (menu_id)
  13. );
  14. -- 系统用户
  15. CREATE TABLE sys_user
  16. (
  17. user_id bigint NOT NULL IDENTITY(1,1),
  18. username varchar(50) NOT NULL,
  19. password varchar(100),
  20. salt varchar(20),
  21. email varchar(100),
  22. mobile varchar(100),
  23. status tinyint,
  24. create_user_id bigint,
  25. create_time datetime,
  26. PRIMARY KEY (user_id),
  27. UNIQUE (username)
  28. );
  29. -- 系统用户Token
  30. CREATE TABLE sys_user_token
  31. (
  32. user_id bigint NOT NULL,
  33. token varchar(100) NOT NULL,
  34. expire_time datetime,
  35. update_time datetime,
  36. PRIMARY KEY (user_id),
  37. UNIQUE (token)
  38. );
  39. -- 系统验证码
  40. CREATE TABLE sys_captcha
  41. (
  42. uuid varchar(36) NOT NULL,
  43. code varchar(6) NOT NULL,
  44. expire_time datetime,
  45. PRIMARY KEY (uuid)
  46. );
  47. -- 角色
  48. CREATE TABLE sys_role
  49. (
  50. role_id bigint NOT NULL IDENTITY(1,1),
  51. role_name varchar(100),
  52. remark varchar(100),
  53. create_user_id bigint,
  54. create_time datetime,
  55. PRIMARY KEY (role_id)
  56. );
  57. -- 用户与角色对应关系
  58. CREATE TABLE sys_user_role
  59. (
  60. id bigint NOT NULL IDENTITY(1,1),
  61. user_id bigint,
  62. role_id bigint,
  63. PRIMARY KEY (id)
  64. );
  65. -- 角色与菜单对应关系
  66. CREATE TABLE sys_role_menu
  67. (
  68. id bigint NOT NULL IDENTITY(1,1),
  69. role_id bigint,
  70. menu_id bigint,
  71. PRIMARY KEY (id)
  72. );
  73. -- 系统配置信息
  74. CREATE TABLE sys_config
  75. (
  76. id bigint NOT NULL IDENTITY(1,1),
  77. param_key varchar(50),
  78. param_value varchar(2000),
  79. status tinyint DEFAULT 1,
  80. remark varchar(500),
  81. PRIMARY KEY (id),
  82. UNIQUE (param_key)
  83. );
  84. -- 系统日志
  85. CREATE TABLE sys_log
  86. (
  87. id bigint NOT NULL IDENTITY(1,1),
  88. username varchar(50),
  89. operation varchar(50),
  90. method varchar(200),
  91. params varchar(5000),
  92. time bigint NOT NULL,
  93. ip varchar(64),
  94. create_date datetime,
  95. PRIMARY KEY (id)
  96. );
  97. -- 文件上传
  98. CREATE TABLE sys_oss
  99. (
  100. id bigint NOT NULL IDENTITY(1,1),
  101. url varchar(200),
  102. create_date datetime,
  103. PRIMARY KEY (id)
  104. );
  105. -- 定时任务
  106. CREATE TABLE schedule_job
  107. (
  108. job_id bigint NOT NULL IDENTITY(1,1),
  109. bean_name varchar(200),
  110. params varchar(2000),
  111. cron_expression varchar(100),
  112. status tinyint,
  113. remark varchar(255),
  114. create_time datetime,
  115. PRIMARY KEY (job_id)
  116. );
  117. -- 定时任务日志
  118. CREATE TABLE schedule_job_log
  119. (
  120. log_id bigint NOT NULL IDENTITY(1,1),
  121. job_id bigint NOT NULL,
  122. bean_name varchar(200),
  123. params varchar(2000),
  124. status tinyint NOT NULL,
  125. error varchar(2000),
  126. times int NOT NULL,
  127. create_time datetime,
  128. PRIMARY KEY (log_id),
  129. INDEX job_id (job_id)
  130. );
  131. -- 用户表
  132. CREATE TABLE tb_user
  133. (
  134. user_id bigint NOT NULL IDENTITY(1,1),
  135. username varchar(50) NOT NULL,
  136. mobile varchar(20) NOT NULL,
  137. password varchar(64),
  138. create_time datetime,
  139. PRIMARY KEY (user_id),
  140. UNIQUE (username)
  141. );
  142. SET
  143. IDENTITY_INSERT sys_user ON;
  144. INSERT INTO sys_user (user_id, username, password, salt, email, mobile, status, create_user_id, create_time)
  145. VALUES ('1', 'admin', '9ec9750e709431dad22365cabc5c625482e574c74adaebba7dd02f1129e4ce1d', 'YzcmCZNvbXocrsz9dm8e',
  146. 'root@renren.io', '13612345678', '1', '1', '2016-11-11 11:11:11');
  147. SET
  148. IDENTITY_INSERT sys_user OFF;
  149. SET
  150. IDENTITY_INSERT sys_menu ON;
  151. INSERT INTO sys_menu(menu_id, parent_id, name, url, perms, type, icon, order_num)
  152. VALUES (1, 0, '系统管理', NULL, NULL, 0, 'system', 0);
  153. INSERT INTO sys_menu(menu_id, parent_id, name, url, perms, type, icon, order_num)
  154. VALUES (2, 1, '管理员列表', 'sys/user', NULL, 1, 'admin', 1);
  155. INSERT INTO sys_menu(menu_id, parent_id, name, url, perms, type, icon, order_num)
  156. VALUES (3, 1, '角色管理', 'sys/role', NULL, 1, 'role', 2);
  157. INSERT INTO sys_menu(menu_id, parent_id, name, url, perms, type, icon, order_num)
  158. VALUES (4, 1, '菜单管理', 'sys/menu', NULL, 1, 'menu', 3);
  159. INSERT INTO sys_menu(menu_id, parent_id, name, url, perms, type, icon, order_num)
  160. -- VALUES (5, 1, 'SQL监控', 'http://localhost:8080/renren-fast/druid/sql.html', NULL, 1, 'sql', 4);
  161. VALUES (5, 1, 'SQL监控', 'http://localhost:8080/mkcloud/druid/sql.html', NULL, 1, 'sql', 4);
  162. INSERT INTO sys_menu(menu_id, parent_id, name, url, perms, type, icon, order_num)
  163. VALUES (6, 1, '定时任务', 'job/schedule', NULL, 1, 'job', 5);
  164. INSERT INTO sys_menu(menu_id, parent_id, name, url, perms, type, icon, order_num)
  165. VALUES (7, 6, '查看', NULL, 'sys:schedule:list,sys:schedule:info', 2, NULL, 0);
  166. INSERT INTO sys_menu(menu_id, parent_id, name, url, perms, type, icon, order_num)
  167. VALUES (8, 6, '新增', NULL, 'sys:schedule:save', 2, NULL, 0);
  168. INSERT INTO sys_menu(menu_id, parent_id, name, url, perms, type, icon, order_num)
  169. VALUES (9, 6, '修改', NULL, 'sys:schedule:update', 2, NULL, 0);
  170. INSERT INTO sys_menu(menu_id, parent_id, name, url, perms, type, icon, order_num)
  171. VALUES (10, 6, '删除', NULL, 'sys:schedule:delete', 2, NULL, 0);
  172. INSERT INTO sys_menu(menu_id, parent_id, name, url, perms, type, icon, order_num)
  173. VALUES (11, 6, '暂停', NULL, 'sys:schedule:pause', 2, NULL, 0);
  174. INSERT INTO sys_menu(menu_id, parent_id, name, url, perms, type, icon, order_num)
  175. VALUES (12, 6, '恢复', NULL, 'sys:schedule:resume', 2, NULL, 0);
  176. INSERT INTO sys_menu(menu_id, parent_id, name, url, perms, type, icon, order_num)
  177. VALUES (13, 6, '立即执行', NULL, 'sys:schedule:run', 2, NULL, 0);
  178. INSERT INTO sys_menu(menu_id, parent_id, name, url, perms, type, icon, order_num)
  179. VALUES (14, 6, '日志列表', NULL, 'sys:schedule:log', 2, NULL, 0);
  180. INSERT INTO sys_menu(menu_id, parent_id, name, url, perms, type, icon, order_num)
  181. VALUES (15, 2, '查看', NULL, 'sys:user:list,sys:user:info', 2, NULL, 0);
  182. INSERT INTO sys_menu(menu_id, parent_id, name, url, perms, type, icon, order_num)
  183. VALUES (16, 2, '新增', NULL, 'sys:user:save,sys:role:select', 2, NULL, 0);
  184. INSERT INTO sys_menu(menu_id, parent_id, name, url, perms, type, icon, order_num)
  185. VALUES (17, 2, '修改', NULL, 'sys:user:update,sys:role:select', 2, NULL, 0);
  186. INSERT INTO sys_menu(menu_id, parent_id, name, url, perms, type, icon, order_num)
  187. VALUES (18, 2, '删除', NULL, 'sys:user:delete', 2, NULL, 0);
  188. INSERT INTO sys_menu(menu_id, parent_id, name, url, perms, type, icon, order_num)
  189. VALUES (19, 3, '查看', NULL, 'sys:role:list,sys:role:info', 2, NULL, 0);
  190. INSERT INTO sys_menu(menu_id, parent_id, name, url, perms, type, icon, order_num)
  191. VALUES (20, 3, '新增', NULL, 'sys:role:save,sys:menu:list', 2, NULL, 0);
  192. INSERT INTO sys_menu(menu_id, parent_id, name, url, perms, type, icon, order_num)
  193. VALUES (21, 3, '修改', NULL, 'sys:role:update,sys:menu:list', 2, NULL, 0);
  194. INSERT INTO sys_menu(menu_id, parent_id, name, url, perms, type, icon, order_num)
  195. VALUES (22, 3, '删除', NULL, 'sys:role:delete', 2, NULL, 0);
  196. INSERT INTO sys_menu(menu_id, parent_id, name, url, perms, type, icon, order_num)
  197. VALUES (23, 4, '查看', NULL, 'sys:menu:list,sys:menu:info', 2, NULL, 0);
  198. INSERT INTO sys_menu(menu_id, parent_id, name, url, perms, type, icon, order_num)
  199. VALUES (24, 4, '新增', NULL, 'sys:menu:save,sys:menu:select', 2, NULL, 0);
  200. INSERT INTO sys_menu(menu_id, parent_id, name, url, perms, type, icon, order_num)
  201. VALUES (25, 4, '修改', NULL, 'sys:menu:update,sys:menu:select', 2, NULL, 0);
  202. INSERT INTO sys_menu(menu_id, parent_id, name, url, perms, type, icon, order_num)
  203. VALUES (26, 4, '删除', NULL, 'sys:menu:delete', 2, NULL, 0);
  204. INSERT INTO sys_menu(menu_id, parent_id, name, url, perms, type, icon, order_num)
  205. VALUES (27, 1, '参数管理', 'sys/config',
  206. 'sys:config:list,sys:config:info,sys:config:save,sys:config:update,sys:config:delete', 1, 'config', 6);
  207. INSERT INTO sys_menu(menu_id, parent_id, name, url, perms, type, icon, order_num)
  208. VALUES (29, 1, '系统日志', 'sys/log', 'sys:log:list', 1, 'log', 7);
  209. INSERT INTO sys_menu(menu_id, parent_id, name, url, perms, type, icon, order_num)
  210. VALUES (30, 1, '文件上传', 'oss/oss', 'sys:oss:all', 1, 'oss', 6);
  211. SET
  212. IDENTITY_INSERT sys_menu OFF;
  213. INSERT INTO sys_config (param_key, param_value, status, remark)
  214. VALUES ('CLOUD_STORAGE_CONFIG_KEY',
  215. '{"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}',
  216. '0', '云存储配置信息');
  217. INSERT INTO schedule_job (bean_name, params, cron_expression, status, remark, create_time)
  218. VALUES ('testTask', 'renren', '0 0/30 * * * ?', '0', '参数测试', '2016-12-01 23:16:46');
  219. -- 账号:13612345678 密码:admin
  220. INSERT INTO tb_user (username, mobile, password, create_time)
  221. VALUES ('mark', '13612345678', '8c6976e5b5410415bde908bd4dee15dfb167a9c873fc4bb8a81f6f2ab448a918',
  222. '2017-03-23 22:37:41');
  223. -- quartz自带表结构
  224. IF
  225. EXISTS (SELECT * FROM dbo.sysobjects WHERE id = OBJECT_ID(N'[dbo].[FK_QRTZ_TRIGGERS_QRTZ_JOB_DETAILS]') AND OBJECTPROPERTY(id, N'ISFOREIGNKEY') = 1)
  226. ALTER TABLE [dbo].[QRTZ_TRIGGERS] DROP CONSTRAINT FK_QRTZ_TRIGGERS_QRTZ_JOB_DETAILS
  227. GO
  228. IF EXISTS (SELECT * FROM dbo.sysobjects WHERE id = OBJECT_ID(N'[dbo].[FK_QRTZ_CRON_TRIGGERS_QRTZ_TRIGGERS]') AND OBJECTPROPERTY(id, N'ISFOREIGNKEY') = 1)
  229. ALTER TABLE [dbo].[QRTZ_CRON_TRIGGERS] DROP CONSTRAINT FK_QRTZ_CRON_TRIGGERS_QRTZ_TRIGGERS
  230. GO
  231. IF EXISTS (SELECT * FROM dbo.sysobjects WHERE id = OBJECT_ID(N'[dbo].[FK_QRTZ_SIMPLE_TRIGGERS_QRTZ_TRIGGERS]') AND OBJECTPROPERTY(id, N'ISFOREIGNKEY') = 1)
  232. ALTER TABLE [dbo].[QRTZ_SIMPLE_TRIGGERS] DROP CONSTRAINT FK_QRTZ_SIMPLE_TRIGGERS_QRTZ_TRIGGERS
  233. GO
  234. IF EXISTS (SELECT * FROM dbo.sysobjects WHERE id = OBJECT_ID(N'[dbo].[FK_QRTZ_SIMPROP_TRIGGERS_QRTZ_TRIGGERS]') AND OBJECTPROPERTY(id, N'ISFOREIGNKEY') = 1)
  235. ALTER TABLE [dbo].[QRTZ_SIMPROP_TRIGGERS] DROP CONSTRAINT FK_QRTZ_SIMPROP_TRIGGERS_QRTZ_TRIGGERS
  236. GO
  237. IF EXISTS (SELECT * FROM dbo.sysobjects WHERE id = OBJECT_ID(N'[dbo].[QRTZ_CALENDARS]') AND OBJECTPROPERTY(id, N'ISUSERTABLE') = 1)
  238. DROP TABLE [dbo].[QRTZ_CALENDARS]
  239. GO
  240. IF EXISTS (SELECT * FROM dbo.sysobjects WHERE id = OBJECT_ID(N'[dbo].[QRTZ_CRON_TRIGGERS]') AND OBJECTPROPERTY(id, N'ISUSERTABLE') = 1)
  241. DROP TABLE [dbo].[QRTZ_CRON_TRIGGERS]
  242. GO
  243. IF EXISTS (SELECT * FROM dbo.sysobjects WHERE id = OBJECT_ID(N'[dbo].[QRTZ_BLOB_TRIGGERS]') AND OBJECTPROPERTY(id, N'ISUSERTABLE') = 1)
  244. DROP TABLE [dbo].[QRTZ_BLOB_TRIGGERS]
  245. GO
  246. IF EXISTS (SELECT * FROM dbo.sysobjects WHERE id = OBJECT_ID(N'[dbo].[QRTZ_FIRED_TRIGGERS]') AND OBJECTPROPERTY(id, N'ISUSERTABLE') = 1)
  247. DROP TABLE [dbo].[QRTZ_FIRED_TRIGGERS]
  248. GO
  249. IF EXISTS (SELECT * FROM dbo.sysobjects WHERE id = OBJECT_ID(N'[dbo].[QRTZ_PAUSED_TRIGGER_GRPS]') AND OBJECTPROPERTY(id, N'ISUSERTABLE') = 1)
  250. DROP TABLE [dbo].[QRTZ_PAUSED_TRIGGER_GRPS]
  251. GO
  252. IF EXISTS (SELECT * FROM dbo.sysobjects WHERE id = OBJECT_ID(N'[dbo].[QRTZ_SCHEDULER_STATE]') AND OBJECTPROPERTY(id, N'ISUSERTABLE') = 1)
  253. DROP TABLE [dbo].[QRTZ_SCHEDULER_STATE]
  254. GO
  255. IF EXISTS (SELECT * FROM dbo.sysobjects WHERE id = OBJECT_ID(N'[dbo].[QRTZ_LOCKS]') AND OBJECTPROPERTY(id, N'ISUSERTABLE') = 1)
  256. DROP TABLE [dbo].[QRTZ_LOCKS]
  257. GO
  258. IF EXISTS (SELECT * FROM dbo.sysobjects WHERE id = OBJECT_ID(N'[dbo].[QRTZ_JOB_DETAILS]') AND OBJECTPROPERTY(id, N'ISUSERTABLE') = 1)
  259. DROP TABLE [dbo].[QRTZ_JOB_DETAILS]
  260. GO
  261. IF EXISTS (SELECT * FROM dbo.sysobjects WHERE id = OBJECT_ID(N'[dbo].[QRTZ_SIMPLE_TRIGGERS]') AND OBJECTPROPERTY(id, N'ISUSERTABLE') = 1)
  262. DROP TABLE [dbo].[QRTZ_SIMPLE_TRIGGERS]
  263. GO
  264. IF EXISTS (SELECT * FROM dbo.sysobjects WHERE id = OBJECT_ID(N'[dbo].[QRTZ_SIMPROP_TRIGGERS]') AND OBJECTPROPERTY(id, N'ISUSERTABLE') = 1)
  265. DROP TABLE [dbo].[QRTZ_SIMPROP_TRIGGERS]
  266. GO
  267. IF EXISTS (SELECT * FROM dbo.sysobjects WHERE id = OBJECT_ID(N'[dbo].[QRTZ_TRIGGERS]') AND OBJECTPROPERTY(id, N'ISUSERTABLE') = 1)
  268. DROP TABLE [dbo].[QRTZ_TRIGGERS]
  269. GO
  270. CREATE TABLE [dbo].[QRTZ_CALENDARS]
  271. (
  272. [
  273. SCHED_NAME] [
  274. VARCHAR]
  275. (
  276. 120
  277. ) NOT NULL ,
  278. [CALENDAR_NAME] [VARCHAR]
  279. (
  280. 200
  281. ) NOT NULL ,
  282. [CALENDAR] [IMAGE] NOT NULL
  283. ) ON [PRIMARY]
  284. GO
  285. CREATE TABLE [dbo].[QRTZ_CRON_TRIGGERS]
  286. (
  287. [
  288. SCHED_NAME] [
  289. VARCHAR]
  290. (
  291. 120
  292. ) NOT NULL ,
  293. [TRIGGER_NAME] [VARCHAR]
  294. (
  295. 200
  296. ) NOT NULL ,
  297. [TRIGGER_GROUP] [VARCHAR]
  298. (
  299. 200
  300. ) NOT NULL ,
  301. [CRON_EXPRESSION] [VARCHAR]
  302. (
  303. 120
  304. ) NOT NULL ,
  305. [TIME_ZONE_ID] [VARCHAR]
  306. (
  307. 80
  308. )
  309. ) ON [PRIMARY]
  310. GO
  311. CREATE TABLE [dbo].[QRTZ_FIRED_TRIGGERS]
  312. (
  313. [
  314. SCHED_NAME] [
  315. VARCHAR]
  316. (
  317. 120
  318. ) NOT NULL ,
  319. [ENTRY_ID] [VARCHAR]
  320. (
  321. 95
  322. ) NOT NULL ,
  323. [TRIGGER_NAME] [VARCHAR]
  324. (
  325. 200
  326. ) NOT NULL ,
  327. [TRIGGER_GROUP] [VARCHAR]
  328. (
  329. 200
  330. ) NOT NULL ,
  331. [INSTANCE_NAME] [VARCHAR]
  332. (
  333. 200
  334. ) NOT NULL ,
  335. [FIRED_TIME] [BIGINT] NOT NULL ,
  336. [SCHED_TIME] [BIGINT] NOT NULL ,
  337. [PRIORITY] [INTEGER] NOT NULL ,
  338. [STATE] [VARCHAR]
  339. (
  340. 16
  341. ) NOT NULL,
  342. [JOB_NAME] [VARCHAR]
  343. (
  344. 200
  345. ) NULL ,
  346. [JOB_GROUP] [VARCHAR]
  347. (
  348. 200
  349. ) NULL ,
  350. [IS_NONCONCURRENT] [VARCHAR]
  351. (
  352. 1
  353. ) NULL ,
  354. [REQUESTS_RECOVERY] [VARCHAR]
  355. (
  356. 1
  357. ) NULL
  358. ) ON [PRIMARY]
  359. GO
  360. CREATE TABLE [dbo].[QRTZ_PAUSED_TRIGGER_GRPS]
  361. (
  362. [
  363. SCHED_NAME] [
  364. VARCHAR]
  365. (
  366. 120
  367. ) NOT NULL ,
  368. [TRIGGER_GROUP] [VARCHAR]
  369. (
  370. 200
  371. ) NOT NULL
  372. ) ON [PRIMARY]
  373. GO
  374. CREATE TABLE [dbo].[QRTZ_SCHEDULER_STATE]
  375. (
  376. [
  377. SCHED_NAME] [
  378. VARCHAR]
  379. (
  380. 120
  381. ) NOT NULL ,
  382. [INSTANCE_NAME] [VARCHAR]
  383. (
  384. 200
  385. ) NOT NULL ,
  386. [LAST_CHECKIN_TIME] [BIGINT] NOT NULL ,
  387. [CHECKIN_INTERVAL] [BIGINT] NOT NULL
  388. ) ON [PRIMARY]
  389. GO
  390. CREATE TABLE [dbo].[QRTZ_LOCKS]
  391. (
  392. [
  393. SCHED_NAME] [
  394. VARCHAR]
  395. (
  396. 120
  397. ) NOT NULL ,
  398. [LOCK_NAME] [VARCHAR]
  399. (
  400. 40
  401. ) NOT NULL
  402. ) ON [PRIMARY]
  403. GO
  404. CREATE TABLE [dbo].[QRTZ_JOB_DETAILS]
  405. (
  406. [
  407. SCHED_NAME] [
  408. VARCHAR]
  409. (
  410. 120
  411. ) NOT NULL ,
  412. [JOB_NAME] [VARCHAR]
  413. (
  414. 200
  415. ) NOT NULL ,
  416. [JOB_GROUP] [VARCHAR]
  417. (
  418. 200
  419. ) NOT NULL ,
  420. [DESCRIPTION] [VARCHAR]
  421. (
  422. 250
  423. ) NULL ,
  424. [JOB_CLASS_NAME] [VARCHAR]
  425. (
  426. 250
  427. ) NOT NULL ,
  428. [IS_DURABLE] [VARCHAR]
  429. (
  430. 1
  431. ) NOT NULL ,
  432. [IS_NONCONCURRENT] [VARCHAR]
  433. (
  434. 1
  435. ) NOT NULL ,
  436. [IS_UPDATE_DATA] [VARCHAR]
  437. (
  438. 1
  439. ) NOT NULL ,
  440. [REQUESTS_RECOVERY] [VARCHAR]
  441. (
  442. 1
  443. ) NOT NULL ,
  444. [JOB_DATA] [IMAGE] NULL
  445. ) ON [PRIMARY]
  446. GO
  447. CREATE TABLE [dbo].[QRTZ_SIMPLE_TRIGGERS]
  448. (
  449. [
  450. SCHED_NAME] [
  451. VARCHAR]
  452. (
  453. 120
  454. ) NOT NULL ,
  455. [TRIGGER_NAME] [VARCHAR]
  456. (
  457. 200
  458. ) NOT NULL ,
  459. [TRIGGER_GROUP] [VARCHAR]
  460. (
  461. 200
  462. ) NOT NULL ,
  463. [REPEAT_COUNT] [BIGINT] NOT NULL ,
  464. [REPEAT_INTERVAL] [BIGINT] NOT NULL ,
  465. [TIMES_TRIGGERED] [BIGINT] NOT NULL
  466. ) ON [PRIMARY]
  467. GO
  468. CREATE TABLE [dbo].[QRTZ_SIMPROP_TRIGGERS]
  469. (
  470. [
  471. SCHED_NAME] [
  472. VARCHAR]
  473. (
  474. 120
  475. ) NOT NULL ,
  476. [TRIGGER_NAME] [VARCHAR]
  477. (
  478. 200
  479. ) NOT NULL ,
  480. [TRIGGER_GROUP] [VARCHAR]
  481. (
  482. 200
  483. ) NOT NULL ,
  484. [STR_PROP_1] [VARCHAR]
  485. (
  486. 512
  487. ) NULL,
  488. [STR_PROP_2] [VARCHAR]
  489. (
  490. 512
  491. ) NULL,
  492. [STR_PROP_3] [VARCHAR]
  493. (
  494. 512
  495. ) NULL,
  496. [INT_PROP_1] [INT] NULL,
  497. [INT_PROP_2] [INT] NULL,
  498. [LONG_PROP_1] [BIGINT] NULL,
  499. [LONG_PROP_2] [BIGINT] NULL,
  500. [DEC_PROP_1] [NUMERIC]
  501. (
  502. 13,
  503. 4
  504. ) NULL,
  505. [DEC_PROP_2] [NUMERIC]
  506. (
  507. 13,
  508. 4
  509. ) NULL,
  510. [BOOL_PROP_1] [VARCHAR]
  511. (
  512. 1
  513. ) NULL,
  514. [BOOL_PROP_2] [VARCHAR]
  515. (
  516. 1
  517. ) NULL,
  518. ) ON [PRIMARY]
  519. GO
  520. CREATE TABLE [dbo].[QRTZ_BLOB_TRIGGERS]
  521. (
  522. [
  523. SCHED_NAME] [
  524. VARCHAR]
  525. (
  526. 120
  527. ) NOT NULL ,
  528. [TRIGGER_NAME] [VARCHAR]
  529. (
  530. 200
  531. ) NOT NULL ,
  532. [TRIGGER_GROUP] [VARCHAR]
  533. (
  534. 200
  535. ) NOT NULL ,
  536. [BLOB_DATA] [IMAGE] NULL
  537. ) ON [PRIMARY]
  538. GO
  539. CREATE TABLE [dbo].[QRTZ_TRIGGERS]
  540. (
  541. [
  542. SCHED_NAME] [
  543. VARCHAR]
  544. (
  545. 120
  546. ) NOT NULL ,
  547. [TRIGGER_NAME] [VARCHAR]
  548. (
  549. 200
  550. ) NOT NULL ,
  551. [TRIGGER_GROUP] [VARCHAR]
  552. (
  553. 200
  554. ) NOT NULL ,
  555. [JOB_NAME] [VARCHAR]
  556. (
  557. 200
  558. ) NOT NULL ,
  559. [JOB_GROUP] [VARCHAR]
  560. (
  561. 200
  562. ) NOT NULL ,
  563. [DESCRIPTION] [VARCHAR]
  564. (
  565. 250
  566. ) NULL ,
  567. [NEXT_FIRE_TIME] [BIGINT] NULL ,
  568. [PREV_FIRE_TIME] [BIGINT] NULL ,
  569. [PRIORITY] [INTEGER] NULL ,
  570. [TRIGGER_STATE] [VARCHAR]
  571. (
  572. 16
  573. ) NOT NULL ,
  574. [TRIGGER_TYPE] [VARCHAR]
  575. (
  576. 8
  577. ) NOT NULL ,
  578. [START_TIME] [BIGINT] NOT NULL ,
  579. [END_TIME] [BIGINT] NULL ,
  580. [CALENDAR_NAME] [VARCHAR]
  581. (
  582. 200
  583. ) NULL ,
  584. [MISFIRE_INSTR] [SMALLINT] NULL ,
  585. [JOB_DATA] [IMAGE] NULL
  586. ) ON [PRIMARY]
  587. GO
  588. ALTER TABLE [dbo].[QRTZ_CALENDARS] WITH NOCHECK ADD
  589. CONSTRAINT [PK_QRTZ_CALENDARS] PRIMARY KEY CLUSTERED
  590. (
  591. [SCHED_NAME],
  592. [CALENDAR_NAME]
  593. ) ON [PRIMARY]
  594. GO
  595. ALTER TABLE [dbo].[QRTZ_CRON_TRIGGERS] WITH NOCHECK ADD
  596. CONSTRAINT [PK_QRTZ_CRON_TRIGGERS] PRIMARY KEY CLUSTERED
  597. (
  598. [SCHED_NAME],
  599. [TRIGGER_NAME],
  600. [TRIGGER_GROUP]
  601. ) ON [PRIMARY]
  602. GO
  603. ALTER TABLE [dbo].[QRTZ_FIRED_TRIGGERS] WITH NOCHECK ADD
  604. CONSTRAINT [PK_QRTZ_FIRED_TRIGGERS] PRIMARY KEY CLUSTERED
  605. (
  606. [SCHED_NAME],
  607. [ENTRY_ID]
  608. ) ON [PRIMARY]
  609. GO
  610. ALTER TABLE [dbo].[QRTZ_PAUSED_TRIGGER_GRPS] WITH NOCHECK ADD
  611. CONSTRAINT [PK_QRTZ_PAUSED_TRIGGER_GRPS] PRIMARY KEY CLUSTERED
  612. (
  613. [SCHED_NAME],
  614. [TRIGGER_GROUP]
  615. ) ON [PRIMARY]
  616. GO
  617. ALTER TABLE [dbo].[QRTZ_SCHEDULER_STATE] WITH NOCHECK ADD
  618. CONSTRAINT [PK_QRTZ_SCHEDULER_STATE] PRIMARY KEY CLUSTERED
  619. (
  620. [SCHED_NAME],
  621. [INSTANCE_NAME]
  622. ) ON [PRIMARY]
  623. GO
  624. ALTER TABLE [dbo].[QRTZ_LOCKS] WITH NOCHECK ADD
  625. CONSTRAINT [PK_QRTZ_LOCKS] PRIMARY KEY CLUSTERED
  626. (
  627. [SCHED_NAME],
  628. [LOCK_NAME]
  629. ) ON [PRIMARY]
  630. GO
  631. ALTER TABLE [dbo].[QRTZ_JOB_DETAILS] WITH NOCHECK ADD
  632. CONSTRAINT [PK_QRTZ_JOB_DETAILS] PRIMARY KEY CLUSTERED
  633. (
  634. [SCHED_NAME],
  635. [JOB_NAME],
  636. [JOB_GROUP]
  637. ) ON [PRIMARY]
  638. GO
  639. ALTER TABLE [dbo].[QRTZ_SIMPLE_TRIGGERS] WITH NOCHECK ADD
  640. CONSTRAINT [PK_QRTZ_SIMPLE_TRIGGERS] PRIMARY KEY CLUSTERED
  641. (
  642. [SCHED_NAME],
  643. [TRIGGER_NAME],
  644. [TRIGGER_GROUP]
  645. ) ON [PRIMARY]
  646. GO
  647. ALTER TABLE [dbo].[QRTZ_SIMPROP_TRIGGERS] WITH NOCHECK ADD
  648. CONSTRAINT [PK_QRTZ_SIMPROP_TRIGGERS] PRIMARY KEY CLUSTERED
  649. (
  650. [SCHED_NAME],
  651. [TRIGGER_NAME],
  652. [TRIGGER_GROUP]
  653. ) ON [PRIMARY]
  654. GO
  655. ALTER TABLE [dbo].[QRTZ_TRIGGERS] WITH NOCHECK ADD
  656. CONSTRAINT [PK_QRTZ_TRIGGERS] PRIMARY KEY CLUSTERED
  657. (
  658. [SCHED_NAME],
  659. [TRIGGER_NAME],
  660. [TRIGGER_GROUP]
  661. ) ON [PRIMARY]
  662. GO
  663. ALTER TABLE [dbo].[QRTZ_CRON_TRIGGERS] ADD
  664. CONSTRAINT [FK_QRTZ_CRON_TRIGGERS_QRTZ_TRIGGERS] FOREIGN KEY
  665. (
  666. [SCHED_NAME],
  667. [TRIGGER_NAME],
  668. [TRIGGER_GROUP]
  669. ) REFERENCES [dbo].[QRTZ_TRIGGERS] (
  670. [SCHED_NAME],
  671. [TRIGGER_NAME],
  672. [TRIGGER_GROUP]
  673. ) ON
  674. DELETE
  675. CASCADE
  676. GO
  677. ALTER TABLE [dbo].[QRTZ_SIMPLE_TRIGGERS] ADD
  678. CONSTRAINT [FK_QRTZ_SIMPLE_TRIGGERS_QRTZ_TRIGGERS] FOREIGN KEY
  679. (
  680. [SCHED_NAME],
  681. [TRIGGER_NAME],
  682. [TRIGGER_GROUP]
  683. ) REFERENCES [dbo].[QRTZ_TRIGGERS] (
  684. [SCHED_NAME],
  685. [TRIGGER_NAME],
  686. [TRIGGER_GROUP]
  687. ) ON
  688. DELETE
  689. CASCADE
  690. GO
  691. ALTER TABLE [dbo].[QRTZ_SIMPROP_TRIGGERS] ADD
  692. CONSTRAINT [FK_QRTZ_SIMPROP_TRIGGERS_QRTZ_TRIGGERS] FOREIGN KEY
  693. (
  694. [SCHED_NAME],
  695. [TRIGGER_NAME],
  696. [TRIGGER_GROUP]
  697. ) REFERENCES [dbo].[QRTZ_TRIGGERS] (
  698. [SCHED_NAME],
  699. [TRIGGER_NAME],
  700. [TRIGGER_GROUP]
  701. ) ON
  702. DELETE
  703. CASCADE
  704. GO
  705. ALTER TABLE [dbo].[QRTZ_TRIGGERS] ADD
  706. CONSTRAINT [FK_QRTZ_TRIGGERS_QRTZ_JOB_DETAILS] FOREIGN KEY
  707. (
  708. [SCHED_NAME],
  709. [JOB_NAME],
  710. [JOB_GROUP]
  711. ) REFERENCES [dbo].[QRTZ_JOB_DETAILS] (
  712. [SCHED_NAME],
  713. [JOB_NAME],
  714. [JOB_GROUP]
  715. )
  716. GO