dolphinscheduler_h2.sql 36 KB

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