dolphinscheduler_h2.sql 31 KB

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