dolphinscheduler_h2.sql 36 KB

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