dolphinscheduler_h2.sql 36 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031
  1. /*
  2. * Licensed to the Apache Software Foundation (ASF) under one or more
  3. * contributor license agreements. See the NOTICE file distributed with
  4. * this work for additional information regarding copyright ownership.
  5. * The ASF licenses this file to You under the Apache License, Version 2.0
  6. * (the "License"); you may not use this file except in compliance with
  7. * the License. You may obtain a copy of the License at
  8. *
  9. * http://www.apache.org/licenses/LICENSE-2.0
  10. *
  11. * Unless required by applicable law or agreed to in writing, software
  12. * distributed under the License is distributed on an "AS IS" BASIS,
  13. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  14. * See the License for the specific language governing permissions and
  15. * limitations under the License.
  16. */
  17. SET
  18. FOREIGN_KEY_CHECKS=0;
  19. -- ----------------------------
  20. -- Table structure for QRTZ_JOB_DETAILS
  21. -- ----------------------------
  22. DROP TABLE IF EXISTS QRTZ_JOB_DETAILS;
  23. CREATE TABLE QRTZ_JOB_DETAILS
  24. (
  25. SCHED_NAME varchar(120) NOT NULL,
  26. JOB_NAME varchar(200) NOT NULL,
  27. JOB_GROUP varchar(200) NOT NULL,
  28. DESCRIPTION varchar(250) DEFAULT NULL,
  29. JOB_CLASS_NAME varchar(250) NOT NULL,
  30. IS_DURABLE varchar(1) NOT NULL,
  31. IS_NONCONCURRENT varchar(1) NOT NULL,
  32. IS_UPDATE_DATA varchar(1) NOT NULL,
  33. REQUESTS_RECOVERY varchar(1) NOT NULL,
  34. JOB_DATA blob,
  35. PRIMARY KEY (SCHED_NAME, JOB_NAME, JOB_GROUP)
  36. );
  37. -- ----------------------------
  38. -- Table structure for QRTZ_TRIGGERS
  39. -- ----------------------------
  40. DROP TABLE IF EXISTS QRTZ_TRIGGERS;
  41. CREATE TABLE QRTZ_TRIGGERS
  42. (
  43. SCHED_NAME varchar(120) NOT NULL,
  44. TRIGGER_NAME varchar(200) NOT NULL,
  45. TRIGGER_GROUP varchar(200) NOT NULL,
  46. JOB_NAME varchar(200) NOT NULL,
  47. JOB_GROUP varchar(200) NOT NULL,
  48. DESCRIPTION varchar(250) DEFAULT NULL,
  49. NEXT_FIRE_TIME bigint(13) DEFAULT NULL,
  50. PREV_FIRE_TIME bigint(13) DEFAULT NULL,
  51. PRIORITY int(11) DEFAULT NULL,
  52. TRIGGER_STATE varchar(16) NOT NULL,
  53. TRIGGER_TYPE varchar(8) NOT NULL,
  54. START_TIME bigint(13) NOT NULL,
  55. END_TIME bigint(13) DEFAULT NULL,
  56. CALENDAR_NAME varchar(200) DEFAULT NULL,
  57. MISFIRE_INSTR smallint(2) DEFAULT NULL,
  58. JOB_DATA blob,
  59. PRIMARY KEY (SCHED_NAME, TRIGGER_NAME, TRIGGER_GROUP),
  60. CONSTRAINT QRTZ_TRIGGERS_ibfk_1 FOREIGN KEY (SCHED_NAME, JOB_NAME, JOB_GROUP) REFERENCES QRTZ_JOB_DETAILS (SCHED_NAME, JOB_NAME, JOB_GROUP)
  61. );
  62. -- ----------------------------
  63. -- Table structure for QRTZ_BLOB_TRIGGERS
  64. -- ----------------------------
  65. DROP TABLE IF EXISTS QRTZ_BLOB_TRIGGERS;
  66. CREATE TABLE QRTZ_BLOB_TRIGGERS
  67. (
  68. SCHED_NAME varchar(120) NOT NULL,
  69. TRIGGER_NAME varchar(200) NOT NULL,
  70. TRIGGER_GROUP varchar(200) NOT NULL,
  71. BLOB_DATA blob,
  72. PRIMARY KEY (SCHED_NAME, TRIGGER_NAME, TRIGGER_GROUP),
  73. FOREIGN KEY (SCHED_NAME, TRIGGER_NAME, TRIGGER_GROUP) REFERENCES QRTZ_TRIGGERS (SCHED_NAME, TRIGGER_NAME, TRIGGER_GROUP)
  74. );
  75. -- ----------------------------
  76. -- Records of QRTZ_BLOB_TRIGGERS
  77. -- ----------------------------
  78. -- ----------------------------
  79. -- Table structure for QRTZ_CALENDARS
  80. -- ----------------------------
  81. DROP TABLE IF EXISTS QRTZ_CALENDARS;
  82. CREATE TABLE QRTZ_CALENDARS
  83. (
  84. SCHED_NAME varchar(120) NOT NULL,
  85. CALENDAR_NAME varchar(200) NOT NULL,
  86. CALENDAR blob NOT NULL,
  87. PRIMARY KEY (SCHED_NAME, CALENDAR_NAME)
  88. );
  89. -- ----------------------------
  90. -- Records of QRTZ_CALENDARS
  91. -- ----------------------------
  92. -- ----------------------------
  93. -- Table structure for QRTZ_CRON_TRIGGERS
  94. -- ----------------------------
  95. DROP TABLE IF EXISTS QRTZ_CRON_TRIGGERS;
  96. CREATE TABLE QRTZ_CRON_TRIGGERS
  97. (
  98. SCHED_NAME varchar(120) NOT NULL,
  99. TRIGGER_NAME varchar(200) NOT NULL,
  100. TRIGGER_GROUP varchar(200) NOT NULL,
  101. CRON_EXPRESSION varchar(120) NOT NULL,
  102. TIME_ZONE_ID varchar(80) DEFAULT NULL,
  103. PRIMARY KEY (SCHED_NAME, TRIGGER_NAME, TRIGGER_GROUP),
  104. CONSTRAINT QRTZ_CRON_TRIGGERS_ibfk_1 FOREIGN KEY (SCHED_NAME, TRIGGER_NAME, TRIGGER_GROUP) REFERENCES QRTZ_TRIGGERS (SCHED_NAME, TRIGGER_NAME, TRIGGER_GROUP)
  105. );
  106. -- ----------------------------
  107. -- Records of QRTZ_CRON_TRIGGERS
  108. -- ----------------------------
  109. -- ----------------------------
  110. -- Table structure for QRTZ_FIRED_TRIGGERS
  111. -- ----------------------------
  112. DROP TABLE IF EXISTS QRTZ_FIRED_TRIGGERS;
  113. CREATE TABLE QRTZ_FIRED_TRIGGERS
  114. (
  115. SCHED_NAME varchar(120) NOT NULL,
  116. ENTRY_ID varchar(200) NOT NULL,
  117. TRIGGER_NAME varchar(200) NOT NULL,
  118. TRIGGER_GROUP varchar(200) NOT NULL,
  119. INSTANCE_NAME varchar(200) NOT NULL,
  120. FIRED_TIME bigint(13) NOT NULL,
  121. SCHED_TIME bigint(13) NOT NULL,
  122. PRIORITY int(11) NOT NULL,
  123. STATE varchar(16) NOT NULL,
  124. JOB_NAME varchar(200) DEFAULT NULL,
  125. JOB_GROUP varchar(200) DEFAULT NULL,
  126. IS_NONCONCURRENT varchar(1) DEFAULT NULL,
  127. REQUESTS_RECOVERY varchar(1) DEFAULT NULL,
  128. PRIMARY KEY (SCHED_NAME, ENTRY_ID)
  129. );
  130. -- ----------------------------
  131. -- Records of QRTZ_FIRED_TRIGGERS
  132. -- ----------------------------
  133. -- ----------------------------
  134. -- Records of QRTZ_JOB_DETAILS
  135. -- ----------------------------
  136. -- ----------------------------
  137. -- Table structure for QRTZ_LOCKS
  138. -- ----------------------------
  139. DROP TABLE IF EXISTS QRTZ_LOCKS;
  140. CREATE TABLE QRTZ_LOCKS
  141. (
  142. SCHED_NAME varchar(120) NOT NULL,
  143. LOCK_NAME varchar(40) NOT NULL,
  144. PRIMARY KEY (SCHED_NAME, LOCK_NAME)
  145. );
  146. -- ----------------------------
  147. -- Records of QRTZ_LOCKS
  148. -- ----------------------------
  149. -- ----------------------------
  150. -- Table structure for QRTZ_PAUSED_TRIGGER_GRPS
  151. -- ----------------------------
  152. DROP TABLE IF EXISTS QRTZ_PAUSED_TRIGGER_GRPS;
  153. CREATE TABLE QRTZ_PAUSED_TRIGGER_GRPS
  154. (
  155. SCHED_NAME varchar(120) NOT NULL,
  156. TRIGGER_GROUP varchar(200) NOT NULL,
  157. PRIMARY KEY (SCHED_NAME, TRIGGER_GROUP)
  158. );
  159. -- ----------------------------
  160. -- Records of QRTZ_PAUSED_TRIGGER_GRPS
  161. -- ----------------------------
  162. -- ----------------------------
  163. -- Table structure for QRTZ_SCHEDULER_STATE
  164. -- ----------------------------
  165. DROP TABLE IF EXISTS QRTZ_SCHEDULER_STATE;
  166. CREATE TABLE QRTZ_SCHEDULER_STATE
  167. (
  168. SCHED_NAME varchar(120) NOT NULL,
  169. INSTANCE_NAME varchar(200) NOT NULL,
  170. LAST_CHECKIN_TIME bigint(13) NOT NULL,
  171. CHECKIN_INTERVAL bigint(13) NOT NULL,
  172. PRIMARY KEY (SCHED_NAME, INSTANCE_NAME)
  173. );
  174. -- ----------------------------
  175. -- Records of QRTZ_SCHEDULER_STATE
  176. -- ----------------------------
  177. -- ----------------------------
  178. -- Table structure for QRTZ_SIMPLE_TRIGGERS
  179. -- ----------------------------
  180. DROP TABLE IF EXISTS QRTZ_SIMPLE_TRIGGERS;
  181. CREATE TABLE QRTZ_SIMPLE_TRIGGERS
  182. (
  183. SCHED_NAME varchar(120) NOT NULL,
  184. TRIGGER_NAME varchar(200) NOT NULL,
  185. TRIGGER_GROUP varchar(200) NOT NULL,
  186. REPEAT_COUNT bigint(7) NOT NULL,
  187. REPEAT_INTERVAL bigint(12) NOT NULL,
  188. TIMES_TRIGGERED bigint(10) NOT NULL,
  189. PRIMARY KEY (SCHED_NAME, TRIGGER_NAME, TRIGGER_GROUP),
  190. CONSTRAINT QRTZ_SIMPLE_TRIGGERS_ibfk_1 FOREIGN KEY (SCHED_NAME, TRIGGER_NAME, TRIGGER_GROUP) REFERENCES QRTZ_TRIGGERS (SCHED_NAME, TRIGGER_NAME, TRIGGER_GROUP)
  191. );
  192. -- ----------------------------
  193. -- Records of QRTZ_SIMPLE_TRIGGERS
  194. -- ----------------------------
  195. -- ----------------------------
  196. -- Table structure for QRTZ_SIMPROP_TRIGGERS
  197. -- ----------------------------
  198. DROP TABLE IF EXISTS QRTZ_SIMPROP_TRIGGERS;
  199. CREATE TABLE QRTZ_SIMPROP_TRIGGERS
  200. (
  201. SCHED_NAME varchar(120) NOT NULL,
  202. TRIGGER_NAME varchar(200) NOT NULL,
  203. TRIGGER_GROUP varchar(200) NOT NULL,
  204. STR_PROP_1 varchar(512) DEFAULT NULL,
  205. STR_PROP_2 varchar(512) DEFAULT NULL,
  206. STR_PROP_3 varchar(512) DEFAULT NULL,
  207. INT_PROP_1 int(11) DEFAULT NULL,
  208. INT_PROP_2 int(11) DEFAULT NULL,
  209. LONG_PROP_1 bigint(20) DEFAULT NULL,
  210. LONG_PROP_2 bigint(20) DEFAULT NULL,
  211. DEC_PROP_1 decimal(13, 4) DEFAULT NULL,
  212. DEC_PROP_2 decimal(13, 4) DEFAULT NULL,
  213. BOOL_PROP_1 varchar(1) DEFAULT NULL,
  214. BOOL_PROP_2 varchar(1) DEFAULT NULL,
  215. PRIMARY KEY (SCHED_NAME, TRIGGER_NAME, TRIGGER_GROUP),
  216. CONSTRAINT QRTZ_SIMPROP_TRIGGERS_ibfk_1 FOREIGN KEY (SCHED_NAME, TRIGGER_NAME, TRIGGER_GROUP) REFERENCES QRTZ_TRIGGERS (SCHED_NAME, TRIGGER_NAME, TRIGGER_GROUP)
  217. );
  218. -- ----------------------------
  219. -- Records of QRTZ_SIMPROP_TRIGGERS
  220. -- ----------------------------
  221. -- ----------------------------
  222. -- Records of QRTZ_TRIGGERS
  223. -- ----------------------------
  224. -- ----------------------------
  225. -- Table structure for t_ds_access_token
  226. -- ----------------------------
  227. DROP TABLE IF EXISTS t_ds_access_token;
  228. CREATE TABLE t_ds_access_token
  229. (
  230. id int(11) NOT NULL AUTO_INCREMENT,
  231. user_id int(11) DEFAULT NULL,
  232. token varchar(64) DEFAULT NULL,
  233. expire_time datetime DEFAULT NULL,
  234. create_time datetime DEFAULT NULL,
  235. update_time datetime DEFAULT NULL,
  236. PRIMARY KEY (id)
  237. );
  238. -- ----------------------------
  239. -- Records of t_ds_access_token
  240. -- ----------------------------
  241. -- ----------------------------
  242. -- Table structure for t_ds_alert
  243. -- ----------------------------
  244. DROP TABLE IF EXISTS t_ds_alert;
  245. CREATE TABLE t_ds_alert
  246. (
  247. id int(11) NOT NULL AUTO_INCREMENT,
  248. title varchar(64) DEFAULT NULL,
  249. content text,
  250. alert_status tinyint(4) DEFAULT '0',
  251. log text,
  252. alertgroup_id int(11) DEFAULT NULL,
  253. create_time datetime DEFAULT NULL,
  254. update_time datetime DEFAULT NULL,
  255. PRIMARY KEY (id)
  256. );
  257. -- ----------------------------
  258. -- Records of t_ds_alert
  259. -- ----------------------------
  260. -- ----------------------------
  261. -- Table structure for t_ds_alertgroup
  262. -- ----------------------------
  263. DROP TABLE IF EXISTS t_ds_alertgroup;
  264. CREATE TABLE t_ds_alertgroup
  265. (
  266. id int(11) NOT NULL AUTO_INCREMENT,
  267. alert_instance_ids varchar(255) DEFAULT NULL,
  268. create_user_id int(11) DEFAULT NULL,
  269. group_name varchar(255) DEFAULT NULL,
  270. description varchar(255) DEFAULT NULL,
  271. create_time datetime DEFAULT NULL,
  272. update_time datetime DEFAULT NULL,
  273. PRIMARY KEY (id),
  274. UNIQUE KEY t_ds_alertgroup_name_un (group_name)
  275. );
  276. -- ----------------------------
  277. -- Records of t_ds_alertgroup
  278. -- ----------------------------
  279. -- ----------------------------
  280. -- Table structure for t_ds_command
  281. -- ----------------------------
  282. DROP TABLE IF EXISTS t_ds_command;
  283. CREATE TABLE t_ds_command
  284. (
  285. id int(11) NOT NULL AUTO_INCREMENT,
  286. command_type tinyint(4) DEFAULT NULL,
  287. process_definition_code bigint(20) DEFAULT NULL,
  288. command_param text,
  289. task_depend_type tinyint(4) DEFAULT NULL,
  290. failure_strategy tinyint(4) DEFAULT '0',
  291. warning_type tinyint(4) DEFAULT '0',
  292. warning_group_id int(11) DEFAULT NULL,
  293. schedule_time datetime DEFAULT NULL,
  294. start_time datetime DEFAULT NULL,
  295. executor_id int(11) DEFAULT NULL,
  296. update_time datetime DEFAULT NULL,
  297. process_instance_priority int(11) DEFAULT NULL,
  298. worker_group varchar(64),
  299. environment_code bigint(20) DEFAULT '-1',
  300. PRIMARY KEY (id)
  301. );
  302. -- ----------------------------
  303. -- Records of t_ds_command
  304. -- ----------------------------
  305. -- ----------------------------
  306. -- Table structure for t_ds_datasource
  307. -- ----------------------------
  308. DROP TABLE IF EXISTS t_ds_datasource;
  309. CREATE TABLE t_ds_datasource
  310. (
  311. id int(11) NOT NULL AUTO_INCREMENT,
  312. name varchar(64) NOT NULL,
  313. note varchar(255) DEFAULT NULL,
  314. type tinyint(4) NOT NULL,
  315. user_id int(11) NOT NULL,
  316. connection_params text NOT NULL,
  317. create_time datetime NOT NULL,
  318. update_time datetime DEFAULT NULL,
  319. PRIMARY KEY (id),
  320. UNIQUE KEY t_ds_datasource_name_un (name, type)
  321. );
  322. -- ----------------------------
  323. -- Records of t_ds_datasource
  324. -- ----------------------------
  325. -- ----------------------------
  326. -- Table structure for t_ds_error_command
  327. -- ----------------------------
  328. DROP TABLE IF EXISTS t_ds_error_command;
  329. CREATE TABLE t_ds_error_command
  330. (
  331. id int(11) NOT NULL,
  332. command_type tinyint(4) DEFAULT NULL,
  333. executor_id int(11) DEFAULT NULL,
  334. process_definition_code bigint(20) DEFAULT NULL,
  335. command_param text,
  336. task_depend_type tinyint(4) DEFAULT NULL,
  337. failure_strategy tinyint(4) DEFAULT '0',
  338. warning_type tinyint(4) DEFAULT '0',
  339. warning_group_id int(11) DEFAULT NULL,
  340. schedule_time datetime DEFAULT NULL,
  341. start_time datetime DEFAULT NULL,
  342. update_time datetime DEFAULT NULL,
  343. process_instance_priority int(11) DEFAULT NULL,
  344. worker_group varchar(64),
  345. environment_code bigint(20) DEFAULT '-1',
  346. message text,
  347. PRIMARY KEY (id)
  348. );
  349. -- ----------------------------
  350. -- Records of t_ds_error_command
  351. -- ----------------------------
  352. -- ----------------------------
  353. -- Table structure for t_ds_process_definition
  354. -- ----------------------------
  355. DROP TABLE IF EXISTS t_ds_process_definition;
  356. CREATE TABLE t_ds_process_definition
  357. (
  358. id int(11) NOT NULL AUTO_INCREMENT,
  359. code bigint(20) NOT NULL,
  360. name varchar(255) DEFAULT NULL,
  361. version int(11) DEFAULT NULL,
  362. description text,
  363. project_code bigint(20) NOT NULL,
  364. release_state tinyint(4) DEFAULT NULL,
  365. user_id int(11) DEFAULT NULL,
  366. global_params text,
  367. flag tinyint(4) DEFAULT NULL,
  368. locations text,
  369. warning_group_id int(11) DEFAULT NULL,
  370. timeout int(11) DEFAULT '0',
  371. tenant_id int(11) NOT NULL DEFAULT '-1',
  372. create_time datetime NOT NULL,
  373. update_time datetime DEFAULT NULL,
  374. PRIMARY KEY (id),
  375. UNIQUE KEY process_unique (name,project_code) USING BTREE,
  376. UNIQUE KEY code_unique (code)
  377. );
  378. -- ----------------------------
  379. -- Records of t_ds_process_definition
  380. -- ----------------------------
  381. -- ----------------------------
  382. -- Table structure for t_ds_process_definition_log
  383. -- ----------------------------
  384. DROP TABLE IF EXISTS t_ds_process_definition_log;
  385. CREATE TABLE t_ds_process_definition_log
  386. (
  387. id int(11) NOT NULL AUTO_INCREMENT,
  388. code bigint(20) NOT NULL,
  389. name varchar(200) DEFAULT NULL,
  390. version int(11) DEFAULT NULL,
  391. description text,
  392. project_code bigint(20) NOT NULL,
  393. release_state tinyint(4) DEFAULT NULL,
  394. user_id int(11) DEFAULT NULL,
  395. global_params text,
  396. flag tinyint(4) DEFAULT NULL,
  397. locations text,
  398. warning_group_id int(11) DEFAULT NULL,
  399. timeout int(11) DEFAULT '0',
  400. tenant_id int(11) NOT NULL DEFAULT '-1',
  401. operator int(11) DEFAULT NULL,
  402. operate_time datetime DEFAULT NULL,
  403. create_time datetime NOT NULL,
  404. update_time datetime DEFAULT NULL,
  405. PRIMARY KEY (id)
  406. );
  407. -- ----------------------------
  408. -- Table structure for t_ds_task_definition
  409. -- ----------------------------
  410. DROP TABLE IF EXISTS t_ds_task_definition;
  411. CREATE TABLE t_ds_task_definition
  412. (
  413. id int(11) NOT NULL AUTO_INCREMENT,
  414. code bigint(20) NOT NULL,
  415. name varchar(200) DEFAULT NULL,
  416. version int(11) DEFAULT NULL,
  417. description text,
  418. project_code bigint(20) NOT NULL,
  419. user_id int(11) DEFAULT NULL,
  420. task_type varchar(50) NOT NULL,
  421. task_params longtext,
  422. flag tinyint(2) DEFAULT NULL,
  423. task_priority tinyint(4) DEFAULT NULL,
  424. worker_group varchar(200) DEFAULT NULL,
  425. environment_code bigint(20) DEFAULT '-1',
  426. fail_retry_times int(11) DEFAULT NULL,
  427. fail_retry_interval int(11) DEFAULT NULL,
  428. timeout_flag tinyint(2) DEFAULT '0',
  429. timeout_notify_strategy tinyint(4) DEFAULT NULL,
  430. timeout int(11) DEFAULT '0',
  431. delay_time int(11) DEFAULT '0',
  432. resource_ids varchar(255) DEFAULT NULL,
  433. create_time datetime NOT NULL,
  434. update_time datetime DEFAULT NULL,
  435. PRIMARY KEY (id, code),
  436. UNIQUE KEY task_unique (name,project_code) USING BTREE
  437. );
  438. -- ----------------------------
  439. -- Table structure for t_ds_task_definition_log
  440. -- ----------------------------
  441. DROP TABLE IF EXISTS t_ds_task_definition_log;
  442. CREATE TABLE t_ds_task_definition_log
  443. (
  444. id int(11) NOT NULL AUTO_INCREMENT,
  445. code bigint(20) NOT NULL,
  446. name varchar(200) DEFAULT NULL,
  447. version int(11) DEFAULT NULL,
  448. description text,
  449. project_code bigint(20) NOT NULL,
  450. user_id int(11) DEFAULT NULL,
  451. task_type varchar(50) NOT NULL,
  452. task_params text,
  453. flag tinyint(2) DEFAULT NULL,
  454. task_priority tinyint(4) DEFAULT NULL,
  455. worker_group varchar(200) DEFAULT NULL,
  456. environment_code bigint(20) DEFAULT '-1',
  457. fail_retry_times int(11) DEFAULT NULL,
  458. fail_retry_interval int(11) DEFAULT NULL,
  459. timeout_flag tinyint(2) DEFAULT '0',
  460. timeout_notify_strategy tinyint(4) DEFAULT NULL,
  461. timeout int(11) DEFAULT '0',
  462. delay_time int(11) DEFAULT '0',
  463. resource_ids varchar(255) DEFAULT NULL,
  464. operator int(11) DEFAULT NULL,
  465. operate_time datetime DEFAULT NULL,
  466. create_time datetime NOT NULL,
  467. update_time datetime DEFAULT NULL,
  468. PRIMARY KEY (id)
  469. );
  470. -- ----------------------------
  471. -- Table structure for t_ds_process_task_relation
  472. -- ----------------------------
  473. DROP TABLE IF EXISTS t_ds_process_task_relation;
  474. CREATE TABLE t_ds_process_task_relation
  475. (
  476. id int(11) NOT NULL AUTO_INCREMENT,
  477. name varchar(200) DEFAULT NULL,
  478. process_definition_version int(11) DEFAULT NULL,
  479. project_code bigint(20) NOT NULL,
  480. process_definition_code bigint(20) NOT NULL,
  481. pre_task_code bigint(20) NOT NULL,
  482. pre_task_version int(11) NOT NULL,
  483. post_task_code bigint(20) NOT NULL,
  484. post_task_version int(11) NOT NULL,
  485. condition_type tinyint(2) DEFAULT NULL,
  486. condition_params text,
  487. create_time datetime NOT NULL,
  488. update_time datetime DEFAULT NULL,
  489. PRIMARY KEY (id)
  490. );
  491. -- ----------------------------
  492. -- Table structure for t_ds_process_task_relation_log
  493. -- ----------------------------
  494. DROP TABLE IF EXISTS t_ds_process_task_relation_log;
  495. CREATE TABLE t_ds_process_task_relation_log
  496. (
  497. id int(11) NOT NULL AUTO_INCREMENT,
  498. name varchar(200) DEFAULT NULL,
  499. process_definition_version int(11) DEFAULT NULL,
  500. project_code bigint(20) NOT NULL,
  501. process_definition_code bigint(20) NOT NULL,
  502. pre_task_code bigint(20) NOT NULL,
  503. pre_task_version int(11) NOT NULL,
  504. post_task_code bigint(20) NOT NULL,
  505. post_task_version int(11) NOT NULL,
  506. condition_type tinyint(2) DEFAULT NULL,
  507. condition_params text,
  508. operator int(11) DEFAULT NULL,
  509. operate_time datetime DEFAULT NULL,
  510. create_time datetime NOT NULL,
  511. update_time datetime DEFAULT NULL,
  512. PRIMARY KEY (id)
  513. );
  514. -- ----------------------------
  515. -- Table structure for t_ds_process_instance
  516. -- ----------------------------
  517. DROP TABLE IF EXISTS t_ds_process_instance;
  518. CREATE TABLE t_ds_process_instance
  519. (
  520. id int(11) NOT NULL AUTO_INCREMENT,
  521. name varchar(255) DEFAULT NULL,
  522. process_definition_version int(11) DEFAULT NULL,
  523. process_definition_code bigint(20) not NULL,
  524. state tinyint(4) DEFAULT NULL,
  525. recovery tinyint(4) DEFAULT NULL,
  526. start_time datetime DEFAULT NULL,
  527. end_time datetime DEFAULT NULL,
  528. run_times int(11) DEFAULT NULL,
  529. host varchar(135) DEFAULT NULL,
  530. command_type tinyint(4) DEFAULT NULL,
  531. command_param text,
  532. task_depend_type tinyint(4) DEFAULT NULL,
  533. max_try_times tinyint(4) DEFAULT '0',
  534. failure_strategy tinyint(4) DEFAULT '0',
  535. warning_type tinyint(4) DEFAULT '0',
  536. warning_group_id int(11) DEFAULT NULL,
  537. schedule_time datetime DEFAULT NULL,
  538. command_start_time datetime DEFAULT NULL,
  539. global_params text,
  540. flag tinyint(4) DEFAULT '1',
  541. update_time timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  542. is_sub_process int(11) DEFAULT '0',
  543. executor_id int(11) NOT NULL,
  544. history_cmd text,
  545. process_instance_priority int(11) DEFAULT NULL,
  546. worker_group varchar(64) DEFAULT NULL,
  547. environment_code bigint(20) DEFAULT '-1',
  548. timeout int(11) DEFAULT '0',
  549. tenant_id int(11) NOT NULL DEFAULT '-1',
  550. var_pool longtext,
  551. PRIMARY KEY (id)
  552. );
  553. -- ----------------------------
  554. -- Records of t_ds_process_instance
  555. -- ----------------------------
  556. -- ----------------------------
  557. -- Table structure for t_ds_project
  558. -- ----------------------------
  559. DROP TABLE IF EXISTS t_ds_project;
  560. CREATE TABLE t_ds_project
  561. (
  562. id int(11) NOT NULL AUTO_INCREMENT,
  563. name varchar(100) DEFAULT NULL,
  564. code bigint(20) NOT NULL,
  565. description varchar(200) DEFAULT NULL,
  566. user_id int(11) DEFAULT NULL,
  567. flag tinyint(4) DEFAULT '1',
  568. create_time datetime NOT NULL,
  569. update_time datetime DEFAULT NULL,
  570. PRIMARY KEY (id)
  571. );
  572. -- ----------------------------
  573. -- Records of t_ds_project
  574. -- ----------------------------
  575. -- ----------------------------
  576. -- Table structure for t_ds_queue
  577. -- ----------------------------
  578. DROP TABLE IF EXISTS t_ds_queue;
  579. CREATE TABLE t_ds_queue
  580. (
  581. id int(11) NOT NULL AUTO_INCREMENT,
  582. queue_name varchar(64) DEFAULT NULL,
  583. queue varchar(64) DEFAULT NULL,
  584. create_time datetime DEFAULT NULL,
  585. update_time datetime DEFAULT NULL,
  586. PRIMARY KEY (id)
  587. );
  588. -- ----------------------------
  589. -- Records of t_ds_queue
  590. -- ----------------------------
  591. INSERT INTO t_ds_queue
  592. VALUES ('1', 'default', 'default', null, null);
  593. -- ----------------------------
  594. -- Table structure for t_ds_relation_datasource_user
  595. -- ----------------------------
  596. DROP TABLE IF EXISTS t_ds_relation_datasource_user;
  597. CREATE TABLE t_ds_relation_datasource_user
  598. (
  599. id int(11) NOT NULL AUTO_INCREMENT,
  600. user_id int(11) NOT NULL,
  601. datasource_id int(11) DEFAULT NULL,
  602. perm int(11) DEFAULT '1',
  603. create_time datetime DEFAULT NULL,
  604. update_time datetime DEFAULT NULL,
  605. PRIMARY KEY (id)
  606. );
  607. -- ----------------------------
  608. -- Records of t_ds_relation_datasource_user
  609. -- ----------------------------
  610. -- ----------------------------
  611. -- Table structure for t_ds_relation_process_instance
  612. -- ----------------------------
  613. DROP TABLE IF EXISTS t_ds_relation_process_instance;
  614. CREATE TABLE t_ds_relation_process_instance
  615. (
  616. id int(11) NOT NULL AUTO_INCREMENT,
  617. parent_process_instance_id int(11) DEFAULT NULL,
  618. parent_task_instance_id int(11) DEFAULT NULL,
  619. process_instance_id int(11) DEFAULT NULL,
  620. PRIMARY KEY (id)
  621. );
  622. -- ----------------------------
  623. -- Records of t_ds_relation_process_instance
  624. -- ----------------------------
  625. -- ----------------------------
  626. -- Table structure for t_ds_relation_project_user
  627. -- ----------------------------
  628. DROP TABLE IF EXISTS t_ds_relation_project_user;
  629. CREATE TABLE t_ds_relation_project_user
  630. (
  631. id int(11) NOT NULL AUTO_INCREMENT,
  632. user_id int(11) NOT NULL,
  633. project_id int(11) DEFAULT NULL,
  634. perm int(11) DEFAULT '1',
  635. create_time datetime DEFAULT NULL,
  636. update_time datetime DEFAULT NULL,
  637. PRIMARY KEY (id)
  638. );
  639. -- ----------------------------
  640. -- Records of t_ds_relation_project_user
  641. -- ----------------------------
  642. -- ----------------------------
  643. -- Table structure for t_ds_relation_resources_user
  644. -- ----------------------------
  645. DROP TABLE IF EXISTS t_ds_relation_resources_user;
  646. CREATE TABLE t_ds_relation_resources_user
  647. (
  648. id int(11) NOT NULL AUTO_INCREMENT,
  649. user_id int(11) NOT NULL,
  650. resources_id int(11) DEFAULT NULL,
  651. perm int(11) DEFAULT '1',
  652. create_time datetime DEFAULT NULL,
  653. update_time datetime DEFAULT NULL,
  654. PRIMARY KEY (id)
  655. );
  656. -- ----------------------------
  657. -- Records of t_ds_relation_resources_user
  658. -- ----------------------------
  659. -- ----------------------------
  660. -- Table structure for t_ds_relation_udfs_user
  661. -- ----------------------------
  662. DROP TABLE IF EXISTS t_ds_relation_udfs_user;
  663. CREATE TABLE t_ds_relation_udfs_user
  664. (
  665. id int(11) NOT NULL AUTO_INCREMENT,
  666. user_id int(11) NOT NULL,
  667. udf_id int(11) DEFAULT NULL,
  668. perm int(11) DEFAULT '1',
  669. create_time datetime DEFAULT NULL,
  670. update_time datetime DEFAULT NULL,
  671. PRIMARY KEY (id)
  672. );
  673. -- ----------------------------
  674. -- Table structure for t_ds_resources
  675. -- ----------------------------
  676. DROP TABLE IF EXISTS t_ds_resources;
  677. CREATE TABLE t_ds_resources
  678. (
  679. id int(11) NOT NULL AUTO_INCREMENT,
  680. alias varchar(64) DEFAULT NULL,
  681. file_name varchar(64) DEFAULT NULL,
  682. description varchar(255) DEFAULT NULL,
  683. user_id int(11) DEFAULT NULL,
  684. type tinyint(4) DEFAULT NULL,
  685. size bigint(20) DEFAULT NULL,
  686. create_time datetime DEFAULT NULL,
  687. update_time datetime DEFAULT NULL,
  688. pid int(11) DEFAULT NULL,
  689. full_name varchar(64) DEFAULT NULL,
  690. is_directory tinyint(4) DEFAULT NULL,
  691. PRIMARY KEY (id),
  692. UNIQUE KEY t_ds_resources_un (full_name, type)
  693. );
  694. -- ----------------------------
  695. -- Records of t_ds_resources
  696. -- ----------------------------
  697. -- ----------------------------
  698. -- Table structure for t_ds_schedules
  699. -- ----------------------------
  700. DROP TABLE IF EXISTS t_ds_schedules;
  701. CREATE TABLE t_ds_schedules
  702. (
  703. id int(11) NOT NULL AUTO_INCREMENT,
  704. process_definition_code bigint(20) NOT NULL,
  705. start_time datetime NOT NULL,
  706. end_time datetime NOT NULL,
  707. timezone_id varchar(40) DEFAULT NULL,
  708. crontab varchar(255) NOT NULL,
  709. failure_strategy tinyint(4) NOT NULL,
  710. user_id int(11) NOT NULL,
  711. release_state tinyint(4) NOT NULL,
  712. warning_type tinyint(4) NOT NULL,
  713. warning_group_id int(11) DEFAULT NULL,
  714. process_instance_priority int(11) DEFAULT NULL,
  715. worker_group varchar(64) DEFAULT '',
  716. environment_code bigint(20) DEFAULT '-1',
  717. create_time datetime NOT NULL,
  718. update_time datetime NOT NULL,
  719. PRIMARY KEY (id)
  720. );
  721. -- ----------------------------
  722. -- Records of t_ds_schedules
  723. -- ----------------------------
  724. -- ----------------------------
  725. -- Table structure for t_ds_session
  726. -- ----------------------------
  727. DROP TABLE IF EXISTS t_ds_session;
  728. CREATE TABLE t_ds_session
  729. (
  730. id varchar(64) NOT NULL,
  731. user_id int(11) DEFAULT NULL,
  732. ip varchar(45) DEFAULT NULL,
  733. last_login_time datetime DEFAULT NULL,
  734. PRIMARY KEY (id)
  735. );
  736. -- ----------------------------
  737. -- Records of t_ds_session
  738. -- ----------------------------
  739. -- ----------------------------
  740. -- Table structure for t_ds_task_instance
  741. -- ----------------------------
  742. DROP TABLE IF EXISTS t_ds_task_instance;
  743. CREATE TABLE t_ds_task_instance
  744. (
  745. id int(11) NOT NULL AUTO_INCREMENT,
  746. name varchar(255) DEFAULT NULL,
  747. task_type varchar(50) NOT NULL,
  748. task_code bigint(20) NOT NULL,
  749. task_definition_version int(11) DEFAULT NULL,
  750. process_instance_id int(11) DEFAULT NULL,
  751. state tinyint(4) DEFAULT NULL,
  752. submit_time datetime DEFAULT NULL,
  753. start_time datetime DEFAULT NULL,
  754. end_time datetime DEFAULT NULL,
  755. host varchar(135) DEFAULT NULL,
  756. execute_path varchar(200) DEFAULT NULL,
  757. log_path varchar(200) DEFAULT NULL,
  758. alert_flag tinyint(4) DEFAULT NULL,
  759. retry_times int(4) DEFAULT '0',
  760. pid int(4) DEFAULT NULL,
  761. app_link text,
  762. task_params text,
  763. flag tinyint(4) DEFAULT '1',
  764. retry_interval int(4) DEFAULT NULL,
  765. max_retry_times int(2) DEFAULT NULL,
  766. task_instance_priority int(11) DEFAULT NULL,
  767. worker_group varchar(64) DEFAULT NULL,
  768. environment_code bigint(20) DEFAULT '-1',
  769. environment_config text DEFAULT '',
  770. executor_id int(11) DEFAULT NULL,
  771. first_submit_time datetime DEFAULT NULL,
  772. delay_time int(4) DEFAULT '0',
  773. var_pool longtext,
  774. PRIMARY KEY (id),
  775. FOREIGN KEY (process_instance_id) REFERENCES t_ds_process_instance (id) ON DELETE CASCADE
  776. );
  777. -- ----------------------------
  778. -- Records of t_ds_task_instance
  779. -- ----------------------------
  780. -- ----------------------------
  781. -- Table structure for t_ds_tenant
  782. -- ----------------------------
  783. DROP TABLE IF EXISTS t_ds_tenant;
  784. CREATE TABLE t_ds_tenant
  785. (
  786. id int(11) NOT NULL AUTO_INCREMENT,
  787. tenant_code varchar(64) DEFAULT NULL,
  788. description varchar(255) DEFAULT NULL,
  789. queue_id int(11) DEFAULT NULL,
  790. create_time datetime DEFAULT NULL,
  791. update_time datetime DEFAULT NULL,
  792. PRIMARY KEY (id)
  793. );
  794. -- ----------------------------
  795. -- Records of t_ds_tenant
  796. -- ----------------------------
  797. -- ----------------------------
  798. -- Table structure for t_ds_udfs
  799. -- ----------------------------
  800. DROP TABLE IF EXISTS t_ds_udfs;
  801. CREATE TABLE t_ds_udfs
  802. (
  803. id int(11) NOT NULL AUTO_INCREMENT,
  804. user_id int(11) NOT NULL,
  805. func_name varchar(100) NOT NULL,
  806. class_name varchar(255) NOT NULL,
  807. type tinyint(4) NOT NULL,
  808. arg_types varchar(255) DEFAULT NULL,
  809. database varchar(255) DEFAULT NULL,
  810. description varchar(255) DEFAULT NULL,
  811. resource_id int(11) NOT NULL,
  812. resource_name varchar(255) NOT NULL,
  813. create_time datetime NOT NULL,
  814. update_time datetime NOT NULL,
  815. PRIMARY KEY (id)
  816. );
  817. -- ----------------------------
  818. -- Records of t_ds_udfs
  819. -- ----------------------------
  820. -- ----------------------------
  821. -- Table structure for t_ds_user
  822. -- ----------------------------
  823. DROP TABLE IF EXISTS t_ds_user;
  824. CREATE TABLE t_ds_user
  825. (
  826. id int(11) NOT NULL AUTO_INCREMENT,
  827. user_name varchar(64) DEFAULT NULL,
  828. user_password varchar(64) DEFAULT NULL,
  829. user_type tinyint(4) DEFAULT NULL,
  830. email varchar(64) DEFAULT NULL,
  831. phone varchar(11) DEFAULT NULL,
  832. tenant_id int(11) DEFAULT NULL,
  833. create_time datetime DEFAULT NULL,
  834. update_time datetime DEFAULT NULL,
  835. queue varchar(64) DEFAULT NULL,
  836. state int(1) DEFAULT 1,
  837. PRIMARY KEY (id),
  838. UNIQUE KEY user_name_unique (user_name)
  839. );
  840. -- ----------------------------
  841. -- Records of t_ds_user
  842. -- ----------------------------
  843. -- ----------------------------
  844. -- Table structure for t_ds_worker_group
  845. -- ----------------------------
  846. DROP TABLE IF EXISTS t_ds_worker_group;
  847. CREATE TABLE t_ds_worker_group
  848. (
  849. id bigint(11) NOT NULL AUTO_INCREMENT,
  850. name varchar(255) NOT NULL,
  851. addr_list text NULL DEFAULT NULL,
  852. create_time datetime NULL DEFAULT NULL,
  853. update_time datetime NULL DEFAULT NULL,
  854. PRIMARY KEY (id),
  855. UNIQUE KEY name_unique (name)
  856. );
  857. -- ----------------------------
  858. -- Records of t_ds_worker_group
  859. -- ----------------------------
  860. -- ----------------------------
  861. -- Table structure for t_ds_version
  862. -- ----------------------------
  863. DROP TABLE IF EXISTS t_ds_version;
  864. CREATE TABLE t_ds_version
  865. (
  866. id int(11) NOT NULL AUTO_INCREMENT,
  867. version varchar(200) NOT NULL,
  868. PRIMARY KEY (id),
  869. UNIQUE KEY version_UNIQUE (version)
  870. );
  871. -- ----------------------------
  872. -- Records of t_ds_version
  873. -- ----------------------------
  874. INSERT INTO t_ds_version
  875. VALUES ('1', '1.4.0');
  876. -- ----------------------------
  877. -- Records of t_ds_alertgroup
  878. -- ----------------------------
  879. INSERT INTO t_ds_alertgroup(alert_instance_ids, create_user_id, group_name, description, create_time, update_time)
  880. VALUES ('1,2', 1, 'default admin warning group', 'default admin warning group', '2018-11-29 10:20:39',
  881. '2018-11-29 10:20:39');
  882. -- ----------------------------
  883. -- Records of t_ds_user
  884. -- ----------------------------
  885. INSERT INTO t_ds_user
  886. VALUES ('1', 'admin', '7ad2410b2f4c074479a8937a28a22b8f', '0', 'xxx@qq.com', '', '0', '2018-03-27 15:48:50',
  887. '2018-10-24 17:40:22', null, 1);
  888. -- ----------------------------
  889. -- Table structure for t_ds_plugin_define
  890. -- ----------------------------
  891. DROP TABLE IF EXISTS t_ds_plugin_define;
  892. CREATE TABLE t_ds_plugin_define
  893. (
  894. id int NOT NULL AUTO_INCREMENT,
  895. plugin_name varchar(100) NOT NULL,
  896. plugin_type varchar(100) NOT NULL,
  897. plugin_params text,
  898. create_time timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  899. update_time timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  900. PRIMARY KEY (id),
  901. UNIQUE KEY t_ds_plugin_define_UN (plugin_name,plugin_type)
  902. );
  903. -- ----------------------------
  904. -- Table structure for t_ds_alert_plugin_instance
  905. -- ----------------------------
  906. DROP TABLE IF EXISTS t_ds_alert_plugin_instance;
  907. CREATE TABLE t_ds_alert_plugin_instance
  908. (
  909. id int NOT NULL AUTO_INCREMENT,
  910. plugin_define_id int NOT NULL,
  911. plugin_instance_params text,
  912. create_time timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  913. update_time timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  914. instance_name varchar(200) DEFAULT NULL,
  915. PRIMARY KEY (id)
  916. );
  917. --
  918. -- Table structure for table t_ds_environment
  919. --
  920. DROP TABLE IF EXISTS t_ds_environment;
  921. CREATE TABLE t_ds_environment
  922. (
  923. id int NOT NULL AUTO_INCREMENT,
  924. code bigint(20) NOT NULL,
  925. name varchar(100) DEFAULT NULL,
  926. config text DEFAULT NULL,
  927. description text,
  928. operator int DEFAULT NULL,
  929. create_time timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  930. update_time timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  931. PRIMARY KEY (id),
  932. UNIQUE KEY environment_name_unique (name),
  933. UNIQUE KEY environment_code_unique (code)
  934. );
  935. --
  936. -- Table structure for table t_ds_environment_worker_group_relation
  937. --
  938. DROP TABLE IF EXISTS t_ds_environment_worker_group_relation;
  939. CREATE TABLE t_ds_environment_worker_group_relation
  940. (
  941. id int NOT NULL AUTO_INCREMENT,
  942. environment_code bigint(20) NOT NULL,
  943. worker_group varchar(255) NOT NULL,
  944. operator int DEFAULT NULL,
  945. create_time timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  946. update_time timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  947. PRIMARY KEY (id) ,
  948. UNIQUE KEY environment_worker_group_unique (environment_code,worker_group)
  949. );