dolphinscheduler_h2.sql 31 KB

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