dolphinscheduler_h2.sql 36 KB

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