dolphinscheduler_h2.sql 36 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033
  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_id int(11) 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 NULL,
  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_id int(11) 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 NULL,
  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. connects text,
  370. warning_group_id int(11) DEFAULT NULL,
  371. timeout int(11) DEFAULT '0',
  372. tenant_id int(11) NOT NULL DEFAULT '-1',
  373. create_time datetime NOT NULL,
  374. update_time datetime DEFAULT NULL,
  375. PRIMARY KEY (id),
  376. UNIQUE KEY process_unique (name,project_code) USING BTREE,
  377. UNIQUE KEY code_unique (code)
  378. );
  379. -- ----------------------------
  380. -- Records of t_ds_process_definition
  381. -- ----------------------------
  382. -- ----------------------------
  383. -- Table structure for t_ds_process_definition_log
  384. -- ----------------------------
  385. DROP TABLE IF EXISTS t_ds_process_definition_log;
  386. CREATE TABLE t_ds_process_definition_log
  387. (
  388. id int(11) NOT NULL AUTO_INCREMENT,
  389. code bigint(20) NOT NULL,
  390. name varchar(200) DEFAULT NULL,
  391. version int(11) DEFAULT NULL,
  392. description text,
  393. project_code bigint(20) NOT NULL,
  394. release_state tinyint(4) DEFAULT NULL,
  395. user_id int(11) DEFAULT NULL,
  396. global_params text,
  397. flag tinyint(4) DEFAULT NULL,
  398. locations text,
  399. connects text,
  400. warning_group_id int(11) DEFAULT NULL,
  401. timeout int(11) DEFAULT '0',
  402. tenant_id int(11) NOT NULL DEFAULT '-1',
  403. operator int(11) DEFAULT NULL,
  404. operate_time datetime DEFAULT NULL,
  405. create_time datetime NOT NULL,
  406. update_time datetime DEFAULT NULL,
  407. PRIMARY KEY (id)
  408. );
  409. -- ----------------------------
  410. -- Table structure for t_ds_task_definition
  411. -- ----------------------------
  412. DROP TABLE IF EXISTS t_ds_task_definition;
  413. CREATE TABLE t_ds_task_definition
  414. (
  415. id int(11) NOT NULL AUTO_INCREMENT,
  416. code bigint(20) NOT NULL,
  417. name varchar(200) DEFAULT NULL,
  418. version int(11) DEFAULT NULL,
  419. description text,
  420. project_code bigint(20) NOT NULL,
  421. user_id int(11) DEFAULT NULL,
  422. task_type varchar(50) NOT NULL,
  423. task_params longtext,
  424. flag tinyint(2) DEFAULT NULL,
  425. task_priority tinyint(4) DEFAULT NULL,
  426. worker_group varchar(200) DEFAULT NULL,
  427. environment_code bigint(20) DEFAULT NULL,
  428. fail_retry_times int(11) DEFAULT NULL,
  429. fail_retry_interval int(11) DEFAULT NULL,
  430. timeout_flag tinyint(2) DEFAULT '0',
  431. timeout_notify_strategy tinyint(4) DEFAULT NULL,
  432. timeout int(11) DEFAULT '0',
  433. delay_time int(11) DEFAULT '0',
  434. resource_ids varchar(255) DEFAULT NULL,
  435. create_time datetime NOT NULL,
  436. update_time datetime DEFAULT NULL,
  437. PRIMARY KEY (id, code),
  438. UNIQUE KEY task_unique (name,project_code) USING BTREE
  439. );
  440. -- ----------------------------
  441. -- Table structure for t_ds_task_definition_log
  442. -- ----------------------------
  443. DROP TABLE IF EXISTS t_ds_task_definition_log;
  444. CREATE TABLE t_ds_task_definition_log
  445. (
  446. id int(11) NOT NULL AUTO_INCREMENT,
  447. code bigint(20) NOT NULL,
  448. name varchar(200) DEFAULT NULL,
  449. version int(11) DEFAULT NULL,
  450. description text,
  451. project_code bigint(20) NOT NULL,
  452. user_id int(11) DEFAULT NULL,
  453. task_type varchar(50) NOT NULL,
  454. task_params text,
  455. flag tinyint(2) DEFAULT NULL,
  456. task_priority tinyint(4) DEFAULT NULL,
  457. worker_group varchar(200) DEFAULT NULL,
  458. environment_code bigint(20) DEFAULT NULL,
  459. fail_retry_times int(11) DEFAULT NULL,
  460. fail_retry_interval int(11) DEFAULT NULL,
  461. timeout_flag tinyint(2) DEFAULT '0',
  462. timeout_notify_strategy tinyint(4) DEFAULT NULL,
  463. timeout int(11) DEFAULT '0',
  464. delay_time int(11) DEFAULT '0',
  465. resource_ids varchar(255) DEFAULT NULL,
  466. operator int(11) DEFAULT NULL,
  467. operate_time datetime DEFAULT NULL,
  468. create_time datetime NOT NULL,
  469. update_time datetime DEFAULT NULL,
  470. PRIMARY KEY (id)
  471. );
  472. -- ----------------------------
  473. -- Table structure for t_ds_process_task_relation
  474. -- ----------------------------
  475. DROP TABLE IF EXISTS t_ds_process_task_relation;
  476. CREATE TABLE t_ds_process_task_relation
  477. (
  478. id int(11) NOT NULL AUTO_INCREMENT,
  479. name varchar(200) DEFAULT NULL,
  480. process_definition_version int(11) DEFAULT NULL,
  481. project_code bigint(20) NOT NULL,
  482. process_definition_code bigint(20) NOT NULL,
  483. pre_task_code bigint(20) NOT NULL,
  484. pre_task_version int(11) NOT NULL,
  485. post_task_code bigint(20) NOT NULL,
  486. post_task_version int(11) NOT NULL,
  487. condition_type tinyint(2) DEFAULT NULL,
  488. condition_params text,
  489. create_time datetime NOT NULL,
  490. update_time datetime DEFAULT NULL,
  491. PRIMARY KEY (id)
  492. );
  493. -- ----------------------------
  494. -- Table structure for t_ds_process_task_relation_log
  495. -- ----------------------------
  496. DROP TABLE IF EXISTS t_ds_process_task_relation_log;
  497. CREATE TABLE t_ds_process_task_relation_log
  498. (
  499. id int(11) NOT NULL AUTO_INCREMENT,
  500. name varchar(200) DEFAULT NULL,
  501. process_definition_version int(11) DEFAULT NULL,
  502. project_code bigint(20) NOT NULL,
  503. process_definition_code bigint(20) NOT NULL,
  504. pre_task_code bigint(20) NOT NULL,
  505. pre_task_version int(11) NOT NULL,
  506. post_task_code bigint(20) NOT NULL,
  507. post_task_version int(11) NOT NULL,
  508. condition_type tinyint(2) DEFAULT NULL,
  509. condition_params text,
  510. operator int(11) DEFAULT NULL,
  511. operate_time datetime DEFAULT NULL,
  512. create_time datetime NOT NULL,
  513. update_time datetime DEFAULT NULL,
  514. PRIMARY KEY (id)
  515. );
  516. -- ----------------------------
  517. -- Table structure for t_ds_process_instance
  518. -- ----------------------------
  519. DROP TABLE IF EXISTS t_ds_process_instance;
  520. CREATE TABLE t_ds_process_instance
  521. (
  522. id int(11) NOT NULL AUTO_INCREMENT,
  523. name varchar(255) DEFAULT NULL,
  524. process_definition_version int(11) DEFAULT NULL,
  525. process_definition_code bigint(20) not NULL,
  526. state tinyint(4) DEFAULT NULL,
  527. recovery tinyint(4) DEFAULT NULL,
  528. start_time datetime DEFAULT NULL,
  529. end_time datetime DEFAULT NULL,
  530. run_times int(11) DEFAULT NULL,
  531. host varchar(135) DEFAULT NULL,
  532. command_type tinyint(4) DEFAULT NULL,
  533. command_param text,
  534. task_depend_type tinyint(4) DEFAULT NULL,
  535. max_try_times tinyint(4) DEFAULT '0',
  536. failure_strategy tinyint(4) DEFAULT '0',
  537. warning_type tinyint(4) DEFAULT '0',
  538. warning_group_id int(11) DEFAULT NULL,
  539. schedule_time datetime DEFAULT NULL,
  540. command_start_time datetime DEFAULT NULL,
  541. global_params text,
  542. flag tinyint(4) DEFAULT '1',
  543. update_time timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  544. is_sub_process int(11) DEFAULT '0',
  545. executor_id int(11) NOT NULL,
  546. history_cmd text,
  547. process_instance_priority int(11) DEFAULT NULL,
  548. worker_group varchar(64) DEFAULT NULL,
  549. environment_code bigint(20) DEFAULT NULL,
  550. timeout int(11) DEFAULT '0',
  551. tenant_id int(11) NOT NULL DEFAULT '-1',
  552. var_pool longtext,
  553. PRIMARY KEY (id)
  554. );
  555. -- ----------------------------
  556. -- Records of t_ds_process_instance
  557. -- ----------------------------
  558. -- ----------------------------
  559. -- Table structure for t_ds_project
  560. -- ----------------------------
  561. DROP TABLE IF EXISTS t_ds_project;
  562. CREATE TABLE t_ds_project
  563. (
  564. id int(11) NOT NULL AUTO_INCREMENT,
  565. name varchar(100) DEFAULT NULL,
  566. code bigint(20) NOT NULL,
  567. description varchar(200) DEFAULT NULL,
  568. user_id int(11) DEFAULT NULL,
  569. flag tinyint(4) DEFAULT '1',
  570. create_time datetime NOT NULL,
  571. update_time datetime DEFAULT NULL,
  572. PRIMARY KEY (id)
  573. );
  574. -- ----------------------------
  575. -- Records of t_ds_project
  576. -- ----------------------------
  577. -- ----------------------------
  578. -- Table structure for t_ds_queue
  579. -- ----------------------------
  580. DROP TABLE IF EXISTS t_ds_queue;
  581. CREATE TABLE t_ds_queue
  582. (
  583. id int(11) NOT NULL AUTO_INCREMENT,
  584. queue_name varchar(64) DEFAULT NULL,
  585. queue varchar(64) DEFAULT NULL,
  586. create_time datetime DEFAULT NULL,
  587. update_time datetime DEFAULT NULL,
  588. PRIMARY KEY (id)
  589. );
  590. -- ----------------------------
  591. -- Records of t_ds_queue
  592. -- ----------------------------
  593. INSERT INTO t_ds_queue
  594. VALUES ('1', 'default', 'default', null, null);
  595. -- ----------------------------
  596. -- Table structure for t_ds_relation_datasource_user
  597. -- ----------------------------
  598. DROP TABLE IF EXISTS t_ds_relation_datasource_user;
  599. CREATE TABLE t_ds_relation_datasource_user
  600. (
  601. id int(11) NOT NULL AUTO_INCREMENT,
  602. user_id int(11) NOT NULL,
  603. datasource_id int(11) DEFAULT NULL,
  604. perm int(11) DEFAULT '1',
  605. create_time datetime DEFAULT NULL,
  606. update_time datetime DEFAULT NULL,
  607. PRIMARY KEY (id)
  608. );
  609. -- ----------------------------
  610. -- Records of t_ds_relation_datasource_user
  611. -- ----------------------------
  612. -- ----------------------------
  613. -- Table structure for t_ds_relation_process_instance
  614. -- ----------------------------
  615. DROP TABLE IF EXISTS t_ds_relation_process_instance;
  616. CREATE TABLE t_ds_relation_process_instance
  617. (
  618. id int(11) NOT NULL AUTO_INCREMENT,
  619. parent_process_instance_id int(11) DEFAULT NULL,
  620. parent_task_instance_id int(11) DEFAULT NULL,
  621. process_instance_id int(11) DEFAULT NULL,
  622. PRIMARY KEY (id)
  623. );
  624. -- ----------------------------
  625. -- Records of t_ds_relation_process_instance
  626. -- ----------------------------
  627. -- ----------------------------
  628. -- Table structure for t_ds_relation_project_user
  629. -- ----------------------------
  630. DROP TABLE IF EXISTS t_ds_relation_project_user;
  631. CREATE TABLE t_ds_relation_project_user
  632. (
  633. id int(11) NOT NULL AUTO_INCREMENT,
  634. user_id int(11) NOT NULL,
  635. project_id int(11) DEFAULT NULL,
  636. perm int(11) DEFAULT '1',
  637. create_time datetime DEFAULT NULL,
  638. update_time datetime DEFAULT NULL,
  639. PRIMARY KEY (id)
  640. );
  641. -- ----------------------------
  642. -- Records of t_ds_relation_project_user
  643. -- ----------------------------
  644. -- ----------------------------
  645. -- Table structure for t_ds_relation_resources_user
  646. -- ----------------------------
  647. DROP TABLE IF EXISTS t_ds_relation_resources_user;
  648. CREATE TABLE t_ds_relation_resources_user
  649. (
  650. id int(11) NOT NULL AUTO_INCREMENT,
  651. user_id int(11) NOT NULL,
  652. resources_id int(11) DEFAULT NULL,
  653. perm int(11) DEFAULT '1',
  654. create_time datetime DEFAULT NULL,
  655. update_time datetime DEFAULT NULL,
  656. PRIMARY KEY (id)
  657. );
  658. -- ----------------------------
  659. -- Records of t_ds_relation_resources_user
  660. -- ----------------------------
  661. -- ----------------------------
  662. -- Table structure for t_ds_relation_udfs_user
  663. -- ----------------------------
  664. DROP TABLE IF EXISTS t_ds_relation_udfs_user;
  665. CREATE TABLE t_ds_relation_udfs_user
  666. (
  667. id int(11) NOT NULL AUTO_INCREMENT,
  668. user_id int(11) NOT NULL,
  669. udf_id int(11) DEFAULT NULL,
  670. perm int(11) DEFAULT '1',
  671. create_time datetime DEFAULT NULL,
  672. update_time datetime DEFAULT NULL,
  673. PRIMARY KEY (id)
  674. );
  675. -- ----------------------------
  676. -- Table structure for t_ds_resources
  677. -- ----------------------------
  678. DROP TABLE IF EXISTS t_ds_resources;
  679. CREATE TABLE t_ds_resources
  680. (
  681. id int(11) NOT NULL AUTO_INCREMENT,
  682. alias varchar(64) DEFAULT NULL,
  683. file_name varchar(64) DEFAULT NULL,
  684. description varchar(255) DEFAULT NULL,
  685. user_id int(11) DEFAULT NULL,
  686. type tinyint(4) DEFAULT NULL,
  687. size bigint(20) DEFAULT NULL,
  688. create_time datetime DEFAULT NULL,
  689. update_time datetime DEFAULT NULL,
  690. pid int(11) DEFAULT NULL,
  691. full_name varchar(64) DEFAULT NULL,
  692. is_directory tinyint(4) DEFAULT NULL,
  693. PRIMARY KEY (id),
  694. UNIQUE KEY t_ds_resources_un (full_name, type)
  695. );
  696. -- ----------------------------
  697. -- Records of t_ds_resources
  698. -- ----------------------------
  699. -- ----------------------------
  700. -- Table structure for t_ds_schedules
  701. -- ----------------------------
  702. DROP TABLE IF EXISTS t_ds_schedules;
  703. CREATE TABLE t_ds_schedules
  704. (
  705. id int(11) NOT NULL AUTO_INCREMENT,
  706. process_definition_id int(11) NOT NULL,
  707. start_time datetime NOT NULL,
  708. end_time datetime NOT NULL,
  709. timezone_id varchar(40) DEFAULT NULL,
  710. crontab varchar(255) NOT NULL,
  711. failure_strategy tinyint(4) NOT NULL,
  712. user_id int(11) NOT NULL,
  713. release_state tinyint(4) NOT NULL,
  714. warning_type tinyint(4) NOT NULL,
  715. warning_group_id int(11) DEFAULT NULL,
  716. process_instance_priority int(11) DEFAULT NULL,
  717. worker_group varchar(64) DEFAULT '',
  718. environment_code bigint(20) DEFAULT NULL,
  719. create_time datetime NOT NULL,
  720. update_time datetime NOT NULL,
  721. PRIMARY KEY (id)
  722. );
  723. -- ----------------------------
  724. -- Records of t_ds_schedules
  725. -- ----------------------------
  726. -- ----------------------------
  727. -- Table structure for t_ds_session
  728. -- ----------------------------
  729. DROP TABLE IF EXISTS t_ds_session;
  730. CREATE TABLE t_ds_session
  731. (
  732. id varchar(64) NOT NULL,
  733. user_id int(11) DEFAULT NULL,
  734. ip varchar(45) DEFAULT NULL,
  735. last_login_time datetime DEFAULT NULL,
  736. PRIMARY KEY (id)
  737. );
  738. -- ----------------------------
  739. -- Records of t_ds_session
  740. -- ----------------------------
  741. -- ----------------------------
  742. -- Table structure for t_ds_task_instance
  743. -- ----------------------------
  744. DROP TABLE IF EXISTS t_ds_task_instance;
  745. CREATE TABLE t_ds_task_instance
  746. (
  747. id int(11) NOT NULL AUTO_INCREMENT,
  748. name varchar(255) DEFAULT NULL,
  749. task_type varchar(50) NOT NULL,
  750. task_code bigint(20) NOT NULL,
  751. task_definition_version int(11) DEFAULT NULL,
  752. process_instance_id int(11) DEFAULT NULL,
  753. state tinyint(4) DEFAULT NULL,
  754. submit_time datetime DEFAULT NULL,
  755. start_time datetime DEFAULT NULL,
  756. end_time datetime DEFAULT NULL,
  757. host varchar(135) DEFAULT NULL,
  758. execute_path varchar(200) DEFAULT NULL,
  759. log_path varchar(200) DEFAULT NULL,
  760. alert_flag tinyint(4) DEFAULT NULL,
  761. retry_times int(4) DEFAULT '0',
  762. pid int(4) DEFAULT NULL,
  763. app_link text,
  764. task_params text,
  765. flag tinyint(4) DEFAULT '1',
  766. retry_interval int(4) DEFAULT NULL,
  767. max_retry_times int(2) DEFAULT NULL,
  768. task_instance_priority int(11) DEFAULT NULL,
  769. worker_group varchar(64) DEFAULT NULL,
  770. environment_code bigint(20) DEFAULT NULL,
  771. environment_config text DEFAULT '',
  772. executor_id int(11) DEFAULT NULL,
  773. first_submit_time datetime DEFAULT NULL,
  774. delay_time int(4) DEFAULT '0',
  775. var_pool longtext,
  776. PRIMARY KEY (id),
  777. FOREIGN KEY (process_instance_id) REFERENCES t_ds_process_instance (id) ON DELETE CASCADE
  778. );
  779. -- ----------------------------
  780. -- Records of t_ds_task_instance
  781. -- ----------------------------
  782. -- ----------------------------
  783. -- Table structure for t_ds_tenant
  784. -- ----------------------------
  785. DROP TABLE IF EXISTS t_ds_tenant;
  786. CREATE TABLE t_ds_tenant
  787. (
  788. id int(11) NOT NULL AUTO_INCREMENT,
  789. tenant_code varchar(64) DEFAULT NULL,
  790. description varchar(255) DEFAULT NULL,
  791. queue_id int(11) DEFAULT NULL,
  792. create_time datetime DEFAULT NULL,
  793. update_time datetime DEFAULT NULL,
  794. PRIMARY KEY (id)
  795. );
  796. -- ----------------------------
  797. -- Records of t_ds_tenant
  798. -- ----------------------------
  799. -- ----------------------------
  800. -- Table structure for t_ds_udfs
  801. -- ----------------------------
  802. DROP TABLE IF EXISTS t_ds_udfs;
  803. CREATE TABLE t_ds_udfs
  804. (
  805. id int(11) NOT NULL AUTO_INCREMENT,
  806. user_id int(11) NOT NULL,
  807. func_name varchar(100) NOT NULL,
  808. class_name varchar(255) NOT NULL,
  809. type tinyint(4) NOT NULL,
  810. arg_types varchar(255) DEFAULT NULL,
  811. database varchar(255) DEFAULT NULL,
  812. description varchar(255) DEFAULT NULL,
  813. resource_id int(11) NOT NULL,
  814. resource_name varchar(255) NOT NULL,
  815. create_time datetime NOT NULL,
  816. update_time datetime NOT NULL,
  817. PRIMARY KEY (id)
  818. );
  819. -- ----------------------------
  820. -- Records of t_ds_udfs
  821. -- ----------------------------
  822. -- ----------------------------
  823. -- Table structure for t_ds_user
  824. -- ----------------------------
  825. DROP TABLE IF EXISTS t_ds_user;
  826. CREATE TABLE t_ds_user
  827. (
  828. id int(11) NOT NULL AUTO_INCREMENT,
  829. user_name varchar(64) DEFAULT NULL,
  830. user_password varchar(64) DEFAULT NULL,
  831. user_type tinyint(4) DEFAULT NULL,
  832. email varchar(64) DEFAULT NULL,
  833. phone varchar(11) DEFAULT NULL,
  834. tenant_id int(11) DEFAULT NULL,
  835. create_time datetime DEFAULT NULL,
  836. update_time datetime DEFAULT NULL,
  837. queue varchar(64) DEFAULT NULL,
  838. state int(1) DEFAULT 1,
  839. PRIMARY KEY (id),
  840. UNIQUE KEY user_name_unique (user_name)
  841. );
  842. -- ----------------------------
  843. -- Records of t_ds_user
  844. -- ----------------------------
  845. -- ----------------------------
  846. -- Table structure for t_ds_worker_group
  847. -- ----------------------------
  848. DROP TABLE IF EXISTS t_ds_worker_group;
  849. CREATE TABLE t_ds_worker_group
  850. (
  851. id bigint(11) NOT NULL AUTO_INCREMENT,
  852. name varchar(255) NOT NULL,
  853. addr_list text NULL DEFAULT NULL,
  854. create_time datetime NULL DEFAULT NULL,
  855. update_time datetime NULL DEFAULT NULL,
  856. PRIMARY KEY (id),
  857. UNIQUE KEY name_unique (name)
  858. );
  859. -- ----------------------------
  860. -- Records of t_ds_worker_group
  861. -- ----------------------------
  862. -- ----------------------------
  863. -- Table structure for t_ds_version
  864. -- ----------------------------
  865. DROP TABLE IF EXISTS t_ds_version;
  866. CREATE TABLE t_ds_version
  867. (
  868. id int(11) NOT NULL AUTO_INCREMENT,
  869. version varchar(200) NOT NULL,
  870. PRIMARY KEY (id),
  871. UNIQUE KEY version_UNIQUE (version)
  872. );
  873. -- ----------------------------
  874. -- Records of t_ds_version
  875. -- ----------------------------
  876. INSERT INTO t_ds_version
  877. VALUES ('1', '1.4.0');
  878. -- ----------------------------
  879. -- Records of t_ds_alertgroup
  880. -- ----------------------------
  881. INSERT INTO t_ds_alertgroup(alert_instance_ids, create_user_id, group_name, description, create_time, update_time)
  882. VALUES ('1,2', 1, 'default admin warning group', 'default admin warning group', '2018-11-29 10:20:39',
  883. '2018-11-29 10:20:39');
  884. -- ----------------------------
  885. -- Records of t_ds_user
  886. -- ----------------------------
  887. INSERT INTO t_ds_user
  888. VALUES ('1', 'admin', '7ad2410b2f4c074479a8937a28a22b8f', '0', 'xxx@qq.com', '', '0', '2018-03-27 15:48:50',
  889. '2018-10-24 17:40:22', null, 1);
  890. -- ----------------------------
  891. -- Table structure for t_ds_plugin_define
  892. -- ----------------------------
  893. DROP TABLE IF EXISTS t_ds_plugin_define;
  894. CREATE TABLE t_ds_plugin_define
  895. (
  896. id int NOT NULL AUTO_INCREMENT,
  897. plugin_name varchar(100) NOT NULL,
  898. plugin_type varchar(100) NOT NULL,
  899. plugin_params text,
  900. create_time timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  901. update_time timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  902. PRIMARY KEY (id),
  903. UNIQUE KEY t_ds_plugin_define_UN (plugin_name,plugin_type)
  904. );
  905. -- ----------------------------
  906. -- Table structure for t_ds_alert_plugin_instance
  907. -- ----------------------------
  908. DROP TABLE IF EXISTS t_ds_alert_plugin_instance;
  909. CREATE TABLE t_ds_alert_plugin_instance
  910. (
  911. id int NOT NULL AUTO_INCREMENT,
  912. plugin_define_id int NOT NULL,
  913. plugin_instance_params text,
  914. create_time timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  915. update_time timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  916. instance_name varchar(200) DEFAULT NULL,
  917. PRIMARY KEY (id)
  918. );
  919. --
  920. -- Table structure for table t_ds_environment
  921. --
  922. DROP TABLE IF EXISTS t_ds_environment;
  923. CREATE TABLE t_ds_environment
  924. (
  925. id int NOT NULL AUTO_INCREMENT,
  926. code bigint(20) NOT NULL,
  927. name varchar(100) DEFAULT NULL,
  928. config text DEFAULT NULL,
  929. description text,
  930. operator int DEFAULT NULL,
  931. create_time timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  932. update_time timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  933. PRIMARY KEY (id),
  934. UNIQUE KEY environment_name_unique (name),
  935. UNIQUE KEY environment_code_unique (code)
  936. );
  937. --
  938. -- Table structure for table t_ds_environment_worker_group_relation
  939. --
  940. DROP TABLE IF EXISTS t_ds_environment_worker_group_relation;
  941. CREATE TABLE t_ds_environment_worker_group_relation
  942. (
  943. id int NOT NULL AUTO_INCREMENT,
  944. environment_code bigint(20) NOT NULL,
  945. worker_group varchar(255) NOT NULL,
  946. operator int DEFAULT NULL,
  947. create_time timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  948. update_time timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  949. PRIMARY KEY (id) ,
  950. UNIQUE KEY environment_worker_group_unique (environment_code,worker_group)
  951. );