dolphinscheduler_mysql.sql 48 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016
  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_BLOB_TRIGGERS
  20. -- ----------------------------
  21. DROP TABLE IF EXISTS `QRTZ_BLOB_TRIGGERS`;
  22. CREATE TABLE `QRTZ_BLOB_TRIGGERS` (
  23. `SCHED_NAME` varchar(120) NOT NULL,
  24. `TRIGGER_NAME` varchar(200) NOT NULL,
  25. `TRIGGER_GROUP` varchar(200) NOT NULL,
  26. `BLOB_DATA` blob,
  27. PRIMARY KEY (`SCHED_NAME`,`TRIGGER_NAME`,`TRIGGER_GROUP`),
  28. KEY `SCHED_NAME` (`SCHED_NAME`,`TRIGGER_NAME`,`TRIGGER_GROUP`),
  29. CONSTRAINT `QRTZ_BLOB_TRIGGERS_ibfk_1` FOREIGN KEY (`SCHED_NAME`, `TRIGGER_NAME`, `TRIGGER_GROUP`) REFERENCES `QRTZ_TRIGGERS` (`SCHED_NAME`, `TRIGGER_NAME`, `TRIGGER_GROUP`)
  30. ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
  31. -- ----------------------------
  32. -- Records of QRTZ_BLOB_TRIGGERS
  33. -- ----------------------------
  34. -- ----------------------------
  35. -- Table structure for QRTZ_CALENDARS
  36. -- ----------------------------
  37. DROP TABLE IF EXISTS `QRTZ_CALENDARS`;
  38. CREATE TABLE `QRTZ_CALENDARS` (
  39. `SCHED_NAME` varchar(120) NOT NULL,
  40. `CALENDAR_NAME` varchar(200) NOT NULL,
  41. `CALENDAR` blob NOT NULL,
  42. PRIMARY KEY (`SCHED_NAME`,`CALENDAR_NAME`)
  43. ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
  44. -- ----------------------------
  45. -- Records of QRTZ_CALENDARS
  46. -- ----------------------------
  47. -- ----------------------------
  48. -- Table structure for QRTZ_CRON_TRIGGERS
  49. -- ----------------------------
  50. DROP TABLE IF EXISTS `QRTZ_CRON_TRIGGERS`;
  51. CREATE TABLE `QRTZ_CRON_TRIGGERS` (
  52. `SCHED_NAME` varchar(120) NOT NULL,
  53. `TRIGGER_NAME` varchar(200) NOT NULL,
  54. `TRIGGER_GROUP` varchar(200) NOT NULL,
  55. `CRON_EXPRESSION` varchar(120) NOT NULL,
  56. `TIME_ZONE_ID` varchar(80) DEFAULT NULL,
  57. PRIMARY KEY (`SCHED_NAME`,`TRIGGER_NAME`,`TRIGGER_GROUP`),
  58. CONSTRAINT `QRTZ_CRON_TRIGGERS_ibfk_1` FOREIGN KEY (`SCHED_NAME`, `TRIGGER_NAME`, `TRIGGER_GROUP`) REFERENCES `QRTZ_TRIGGERS` (`SCHED_NAME`, `TRIGGER_NAME`, `TRIGGER_GROUP`)
  59. ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
  60. -- ----------------------------
  61. -- Records of QRTZ_CRON_TRIGGERS
  62. -- ----------------------------
  63. -- ----------------------------
  64. -- Table structure for QRTZ_FIRED_TRIGGERS
  65. -- ----------------------------
  66. DROP TABLE IF EXISTS `QRTZ_FIRED_TRIGGERS`;
  67. CREATE TABLE `QRTZ_FIRED_TRIGGERS` (
  68. `SCHED_NAME` varchar(120) NOT NULL,
  69. `ENTRY_ID` varchar(200) NOT NULL,
  70. `TRIGGER_NAME` varchar(200) NOT NULL,
  71. `TRIGGER_GROUP` varchar(200) NOT NULL,
  72. `INSTANCE_NAME` varchar(200) NOT NULL,
  73. `FIRED_TIME` bigint(13) NOT NULL,
  74. `SCHED_TIME` bigint(13) NOT NULL,
  75. `PRIORITY` int(11) NOT NULL,
  76. `STATE` varchar(16) NOT NULL,
  77. `JOB_NAME` varchar(200) DEFAULT NULL,
  78. `JOB_GROUP` varchar(200) DEFAULT NULL,
  79. `IS_NONCONCURRENT` varchar(1) DEFAULT NULL,
  80. `REQUESTS_RECOVERY` varchar(1) DEFAULT NULL,
  81. PRIMARY KEY (`SCHED_NAME`,`ENTRY_ID`),
  82. KEY `IDX_QRTZ_FT_TRIG_INST_NAME` (`SCHED_NAME`,`INSTANCE_NAME`),
  83. KEY `IDX_QRTZ_FT_INST_JOB_REQ_RCVRY` (`SCHED_NAME`,`INSTANCE_NAME`,`REQUESTS_RECOVERY`),
  84. KEY `IDX_QRTZ_FT_J_G` (`SCHED_NAME`,`JOB_NAME`,`JOB_GROUP`),
  85. KEY `IDX_QRTZ_FT_JG` (`SCHED_NAME`,`JOB_GROUP`),
  86. KEY `IDX_QRTZ_FT_T_G` (`SCHED_NAME`,`TRIGGER_NAME`,`TRIGGER_GROUP`),
  87. KEY `IDX_QRTZ_FT_TG` (`SCHED_NAME`,`TRIGGER_GROUP`)
  88. ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
  89. -- ----------------------------
  90. -- Records of QRTZ_FIRED_TRIGGERS
  91. -- ----------------------------
  92. -- ----------------------------
  93. -- Table structure for QRTZ_JOB_DETAILS
  94. -- ----------------------------
  95. DROP TABLE IF EXISTS `QRTZ_JOB_DETAILS`;
  96. CREATE TABLE `QRTZ_JOB_DETAILS` (
  97. `SCHED_NAME` varchar(120) NOT NULL,
  98. `JOB_NAME` varchar(200) NOT NULL,
  99. `JOB_GROUP` varchar(200) NOT NULL,
  100. `DESCRIPTION` varchar(250) DEFAULT NULL,
  101. `JOB_CLASS_NAME` varchar(250) NOT NULL,
  102. `IS_DURABLE` varchar(1) NOT NULL,
  103. `IS_NONCONCURRENT` varchar(1) NOT NULL,
  104. `IS_UPDATE_DATA` varchar(1) NOT NULL,
  105. `REQUESTS_RECOVERY` varchar(1) NOT NULL,
  106. `JOB_DATA` blob,
  107. PRIMARY KEY (`SCHED_NAME`,`JOB_NAME`,`JOB_GROUP`),
  108. KEY `IDX_QRTZ_J_REQ_RECOVERY` (`SCHED_NAME`,`REQUESTS_RECOVERY`),
  109. KEY `IDX_QRTZ_J_GRP` (`SCHED_NAME`,`JOB_GROUP`)
  110. ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
  111. -- ----------------------------
  112. -- Records of QRTZ_JOB_DETAILS
  113. -- ----------------------------
  114. -- ----------------------------
  115. -- Table structure for QRTZ_LOCKS
  116. -- ----------------------------
  117. DROP TABLE IF EXISTS `QRTZ_LOCKS`;
  118. CREATE TABLE `QRTZ_LOCKS` (
  119. `SCHED_NAME` varchar(120) NOT NULL,
  120. `LOCK_NAME` varchar(40) NOT NULL,
  121. PRIMARY KEY (`SCHED_NAME`,`LOCK_NAME`)
  122. ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
  123. -- ----------------------------
  124. -- Records of QRTZ_LOCKS
  125. -- ----------------------------
  126. -- ----------------------------
  127. -- Table structure for QRTZ_PAUSED_TRIGGER_GRPS
  128. -- ----------------------------
  129. DROP TABLE IF EXISTS `QRTZ_PAUSED_TRIGGER_GRPS`;
  130. CREATE TABLE `QRTZ_PAUSED_TRIGGER_GRPS` (
  131. `SCHED_NAME` varchar(120) NOT NULL,
  132. `TRIGGER_GROUP` varchar(200) NOT NULL,
  133. PRIMARY KEY (`SCHED_NAME`,`TRIGGER_GROUP`)
  134. ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
  135. -- ----------------------------
  136. -- Records of QRTZ_PAUSED_TRIGGER_GRPS
  137. -- ----------------------------
  138. -- ----------------------------
  139. -- Table structure for QRTZ_SCHEDULER_STATE
  140. -- ----------------------------
  141. DROP TABLE IF EXISTS `QRTZ_SCHEDULER_STATE`;
  142. CREATE TABLE `QRTZ_SCHEDULER_STATE` (
  143. `SCHED_NAME` varchar(120) NOT NULL,
  144. `INSTANCE_NAME` varchar(200) NOT NULL,
  145. `LAST_CHECKIN_TIME` bigint(13) NOT NULL,
  146. `CHECKIN_INTERVAL` bigint(13) NOT NULL,
  147. PRIMARY KEY (`SCHED_NAME`,`INSTANCE_NAME`)
  148. ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
  149. -- ----------------------------
  150. -- Records of QRTZ_SCHEDULER_STATE
  151. -- ----------------------------
  152. -- ----------------------------
  153. -- Table structure for QRTZ_SIMPLE_TRIGGERS
  154. -- ----------------------------
  155. DROP TABLE IF EXISTS `QRTZ_SIMPLE_TRIGGERS`;
  156. CREATE TABLE `QRTZ_SIMPLE_TRIGGERS` (
  157. `SCHED_NAME` varchar(120) NOT NULL,
  158. `TRIGGER_NAME` varchar(200) NOT NULL,
  159. `TRIGGER_GROUP` varchar(200) NOT NULL,
  160. `REPEAT_COUNT` bigint(7) NOT NULL,
  161. `REPEAT_INTERVAL` bigint(12) NOT NULL,
  162. `TIMES_TRIGGERED` bigint(10) NOT NULL,
  163. PRIMARY KEY (`SCHED_NAME`,`TRIGGER_NAME`,`TRIGGER_GROUP`),
  164. CONSTRAINT `QRTZ_SIMPLE_TRIGGERS_ibfk_1` FOREIGN KEY (`SCHED_NAME`, `TRIGGER_NAME`, `TRIGGER_GROUP`) REFERENCES `QRTZ_TRIGGERS` (`SCHED_NAME`, `TRIGGER_NAME`, `TRIGGER_GROUP`)
  165. ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
  166. -- ----------------------------
  167. -- Records of QRTZ_SIMPLE_TRIGGERS
  168. -- ----------------------------
  169. -- ----------------------------
  170. -- Table structure for QRTZ_SIMPROP_TRIGGERS
  171. -- ----------------------------
  172. DROP TABLE IF EXISTS `QRTZ_SIMPROP_TRIGGERS`;
  173. CREATE TABLE `QRTZ_SIMPROP_TRIGGERS` (
  174. `SCHED_NAME` varchar(120) NOT NULL,
  175. `TRIGGER_NAME` varchar(200) NOT NULL,
  176. `TRIGGER_GROUP` varchar(200) NOT NULL,
  177. `STR_PROP_1` varchar(512) DEFAULT NULL,
  178. `STR_PROP_2` varchar(512) DEFAULT NULL,
  179. `STR_PROP_3` varchar(512) DEFAULT NULL,
  180. `INT_PROP_1` int(11) DEFAULT NULL,
  181. `INT_PROP_2` int(11) DEFAULT NULL,
  182. `LONG_PROP_1` bigint(20) DEFAULT NULL,
  183. `LONG_PROP_2` bigint(20) DEFAULT NULL,
  184. `DEC_PROP_1` decimal(13,4) DEFAULT NULL,
  185. `DEC_PROP_2` decimal(13,4) DEFAULT NULL,
  186. `BOOL_PROP_1` varchar(1) DEFAULT NULL,
  187. `BOOL_PROP_2` varchar(1) DEFAULT NULL,
  188. PRIMARY KEY (`SCHED_NAME`,`TRIGGER_NAME`,`TRIGGER_GROUP`),
  189. CONSTRAINT `QRTZ_SIMPROP_TRIGGERS_ibfk_1` FOREIGN KEY (`SCHED_NAME`, `TRIGGER_NAME`, `TRIGGER_GROUP`) REFERENCES `QRTZ_TRIGGERS` (`SCHED_NAME`, `TRIGGER_NAME`, `TRIGGER_GROUP`)
  190. ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
  191. -- ----------------------------
  192. -- Records of QRTZ_SIMPROP_TRIGGERS
  193. -- ----------------------------
  194. -- ----------------------------
  195. -- Table structure for QRTZ_TRIGGERS
  196. -- ----------------------------
  197. DROP TABLE IF EXISTS `QRTZ_TRIGGERS`;
  198. CREATE TABLE `QRTZ_TRIGGERS` (
  199. `SCHED_NAME` varchar(120) NOT NULL,
  200. `TRIGGER_NAME` varchar(200) NOT NULL,
  201. `TRIGGER_GROUP` varchar(200) NOT NULL,
  202. `JOB_NAME` varchar(200) NOT NULL,
  203. `JOB_GROUP` varchar(200) NOT NULL,
  204. `DESCRIPTION` varchar(250) DEFAULT NULL,
  205. `NEXT_FIRE_TIME` bigint(13) DEFAULT NULL,
  206. `PREV_FIRE_TIME` bigint(13) DEFAULT NULL,
  207. `PRIORITY` int(11) DEFAULT NULL,
  208. `TRIGGER_STATE` varchar(16) NOT NULL,
  209. `TRIGGER_TYPE` varchar(8) NOT NULL,
  210. `START_TIME` bigint(13) NOT NULL,
  211. `END_TIME` bigint(13) DEFAULT NULL,
  212. `CALENDAR_NAME` varchar(200) DEFAULT NULL,
  213. `MISFIRE_INSTR` smallint(2) DEFAULT NULL,
  214. `JOB_DATA` blob,
  215. PRIMARY KEY (`SCHED_NAME`,`TRIGGER_NAME`,`TRIGGER_GROUP`),
  216. KEY `IDX_QRTZ_T_J` (`SCHED_NAME`,`JOB_NAME`,`JOB_GROUP`),
  217. KEY `IDX_QRTZ_T_JG` (`SCHED_NAME`,`JOB_GROUP`),
  218. KEY `IDX_QRTZ_T_C` (`SCHED_NAME`,`CALENDAR_NAME`),
  219. KEY `IDX_QRTZ_T_G` (`SCHED_NAME`,`TRIGGER_GROUP`),
  220. KEY `IDX_QRTZ_T_STATE` (`SCHED_NAME`,`TRIGGER_STATE`),
  221. KEY `IDX_QRTZ_T_N_STATE` (`SCHED_NAME`,`TRIGGER_NAME`,`TRIGGER_GROUP`,`TRIGGER_STATE`),
  222. KEY `IDX_QRTZ_T_N_G_STATE` (`SCHED_NAME`,`TRIGGER_GROUP`,`TRIGGER_STATE`),
  223. KEY `IDX_QRTZ_T_NEXT_FIRE_TIME` (`SCHED_NAME`,`NEXT_FIRE_TIME`),
  224. KEY `IDX_QRTZ_T_NFT_ST` (`SCHED_NAME`,`TRIGGER_STATE`,`NEXT_FIRE_TIME`),
  225. KEY `IDX_QRTZ_T_NFT_MISFIRE` (`SCHED_NAME`,`MISFIRE_INSTR`,`NEXT_FIRE_TIME`),
  226. KEY `IDX_QRTZ_T_NFT_ST_MISFIRE` (`SCHED_NAME`,`MISFIRE_INSTR`,`NEXT_FIRE_TIME`,`TRIGGER_STATE`),
  227. KEY `IDX_QRTZ_T_NFT_ST_MISFIRE_GRP` (`SCHED_NAME`,`MISFIRE_INSTR`,`NEXT_FIRE_TIME`,`TRIGGER_GROUP`,`TRIGGER_STATE`),
  228. CONSTRAINT `QRTZ_TRIGGERS_ibfk_1` FOREIGN KEY (`SCHED_NAME`, `JOB_NAME`, `JOB_GROUP`) REFERENCES `QRTZ_JOB_DETAILS` (`SCHED_NAME`, `JOB_NAME`, `JOB_GROUP`)
  229. ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
  230. -- ----------------------------
  231. -- Records of QRTZ_TRIGGERS
  232. -- ----------------------------
  233. -- ----------------------------
  234. -- Table structure for t_ds_access_token
  235. -- ----------------------------
  236. DROP TABLE IF EXISTS `t_ds_access_token`;
  237. CREATE TABLE `t_ds_access_token` (
  238. `id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'key',
  239. `user_id` int(11) DEFAULT NULL COMMENT 'user id',
  240. `token` varchar(64) DEFAULT NULL COMMENT 'token',
  241. `expire_time` datetime DEFAULT NULL COMMENT 'end time of token ',
  242. `create_time` datetime DEFAULT NULL COMMENT 'create time',
  243. `update_time` datetime DEFAULT NULL COMMENT 'update time',
  244. PRIMARY KEY (`id`)
  245. ) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;
  246. -- ----------------------------
  247. -- Records of t_ds_access_token
  248. -- ----------------------------
  249. -- ----------------------------
  250. -- Table structure for t_ds_alert
  251. -- ----------------------------
  252. DROP TABLE IF EXISTS `t_ds_alert`;
  253. CREATE TABLE `t_ds_alert` (
  254. `id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'key',
  255. `title` varchar(64) DEFAULT NULL COMMENT 'title',
  256. `content` text COMMENT 'Message content (can be email, can be SMS. Mail is stored in JSON map, and SMS is string)',
  257. `alert_status` tinyint(4) DEFAULT '0' COMMENT '0:wait running,1:success,2:failed',
  258. `log` text COMMENT 'log',
  259. `alertgroup_id` int(11) DEFAULT NULL COMMENT 'alert group id',
  260. `create_time` datetime DEFAULT NULL COMMENT 'create time',
  261. `update_time` datetime DEFAULT NULL COMMENT 'update time',
  262. PRIMARY KEY (`id`)
  263. ) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;
  264. -- ----------------------------
  265. -- Records of t_ds_alert
  266. -- ----------------------------
  267. -- ----------------------------
  268. -- Table structure for t_ds_alertgroup
  269. -- ----------------------------
  270. DROP TABLE IF EXISTS `t_ds_alertgroup`;
  271. CREATE TABLE `t_ds_alertgroup`(
  272. `id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'key',
  273. `alert_instance_ids` varchar (255) DEFAULT NULL COMMENT 'alert instance ids',
  274. `create_user_id` int(11) DEFAULT NULL COMMENT 'create user id',
  275. `group_name` varchar(255) DEFAULT NULL COMMENT 'group name',
  276. `description` varchar(255) DEFAULT NULL,
  277. `create_time` datetime DEFAULT NULL COMMENT 'create time',
  278. `update_time` datetime DEFAULT NULL COMMENT 'update time',
  279. PRIMARY KEY (`id`),
  280. UNIQUE KEY `t_ds_alertgroup_name_un` (`group_name`)
  281. ) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;
  282. -- ----------------------------
  283. -- Records of t_ds_alertgroup
  284. -- ----------------------------
  285. -- ----------------------------
  286. -- Table structure for t_ds_command
  287. -- ----------------------------
  288. DROP TABLE IF EXISTS `t_ds_command`;
  289. CREATE TABLE `t_ds_command` (
  290. `id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'key',
  291. `command_type` tinyint(4) DEFAULT NULL COMMENT 'Command type: 0 start workflow, 1 start execution from current node, 2 resume fault-tolerant workflow, 3 resume pause process, 4 start execution from failed node, 5 complement, 6 schedule, 7 rerun, 8 pause, 9 stop, 10 resume waiting thread',
  292. `process_definition_code` bigint(20) NOT NULL COMMENT 'process definition code',
  293. `process_definition_version` int(11) DEFAULT '0' COMMENT 'process definition version',
  294. `process_instance_id` int(11) DEFAULT '0' COMMENT 'process instance id',
  295. `command_param` text COMMENT 'json command parameters',
  296. `task_depend_type` tinyint(4) DEFAULT NULL COMMENT 'Node dependency type: 0 current node, 1 forward, 2 backward',
  297. `failure_strategy` tinyint(4) DEFAULT '0' COMMENT 'Failed policy: 0 end, 1 continue',
  298. `warning_type` tinyint(4) DEFAULT '0' COMMENT 'Alarm type: 0 is not sent, 1 process is sent successfully, 2 process is sent failed, 3 process is sent successfully and all failures are sent',
  299. `warning_group_id` int(11) DEFAULT NULL COMMENT 'warning group',
  300. `schedule_time` datetime DEFAULT NULL COMMENT 'schedule time',
  301. `start_time` datetime DEFAULT NULL COMMENT 'start time',
  302. `executor_id` int(11) DEFAULT NULL COMMENT 'executor id',
  303. `update_time` datetime DEFAULT NULL COMMENT 'update time',
  304. `process_instance_priority` int(11) DEFAULT NULL COMMENT 'process instance priority: 0 Highest,1 High,2 Medium,3 Low,4 Lowest',
  305. `worker_group` varchar(64) COMMENT 'worker group',
  306. `environment_code` bigint(20) DEFAULT '-1' COMMENT 'environment code',
  307. `dry_run` tinyint(4) DEFAULT '0' COMMENT 'dry run flag:0 normal, 1 dry run',
  308. PRIMARY KEY (`id`),
  309. KEY `priority_id_index` (`process_instance_priority`,`id`) USING BTREE
  310. ) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;
  311. -- ----------------------------
  312. -- Records of t_ds_command
  313. -- ----------------------------
  314. -- ----------------------------
  315. -- Table structure for t_ds_datasource
  316. -- ----------------------------
  317. DROP TABLE IF EXISTS `t_ds_datasource`;
  318. CREATE TABLE `t_ds_datasource` (
  319. `id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'key',
  320. `name` varchar(64) NOT NULL COMMENT 'data source name',
  321. `note` varchar(255) DEFAULT NULL COMMENT 'description',
  322. `type` tinyint(4) NOT NULL COMMENT 'data source type: 0:mysql,1:postgresql,2:hive,3:spark',
  323. `user_id` int(11) NOT NULL COMMENT 'the creator id',
  324. `connection_params` text NOT NULL COMMENT 'json connection params',
  325. `create_time` datetime NOT NULL COMMENT 'create time',
  326. `update_time` datetime DEFAULT NULL COMMENT 'update time',
  327. PRIMARY KEY (`id`),
  328. UNIQUE KEY `t_ds_datasource_name_un` (`name`, `type`)
  329. ) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;
  330. -- ----------------------------
  331. -- Records of t_ds_datasource
  332. -- ----------------------------
  333. -- ----------------------------
  334. -- Table structure for t_ds_error_command
  335. -- ----------------------------
  336. DROP TABLE IF EXISTS `t_ds_error_command`;
  337. CREATE TABLE `t_ds_error_command` (
  338. `id` int(11) NOT NULL COMMENT 'key',
  339. `command_type` tinyint(4) DEFAULT NULL COMMENT 'command type',
  340. `executor_id` int(11) DEFAULT NULL COMMENT 'executor id',
  341. `process_definition_code` bigint(20) NOT NULL COMMENT 'process definition code',
  342. `process_definition_version` int(11) DEFAULT '0' COMMENT 'process definition version',
  343. `process_instance_id` int(11) DEFAULT '0' COMMENT 'process instance id: 0',
  344. `command_param` text COMMENT 'json command parameters',
  345. `task_depend_type` tinyint(4) DEFAULT NULL COMMENT 'task depend type',
  346. `failure_strategy` tinyint(4) DEFAULT '0' COMMENT 'failure strategy',
  347. `warning_type` tinyint(4) DEFAULT '0' COMMENT 'warning type',
  348. `warning_group_id` int(11) DEFAULT NULL COMMENT 'warning group id',
  349. `schedule_time` datetime DEFAULT NULL COMMENT 'scheduler time',
  350. `start_time` datetime DEFAULT NULL COMMENT 'start time',
  351. `update_time` datetime DEFAULT NULL COMMENT 'update time',
  352. `process_instance_priority` int(11) DEFAULT NULL COMMENT 'process instance priority, 0 Highest,1 High,2 Medium,3 Low,4 Lowest',
  353. `worker_group` varchar(64) COMMENT 'worker group',
  354. `environment_code` bigint(20) DEFAULT '-1' COMMENT 'environment code',
  355. `message` text COMMENT 'message',
  356. `dry_run` tinyint(4) DEFAULT '0' COMMENT 'dry run flag: 0 normal, 1 dry run',
  357. PRIMARY KEY (`id`) USING BTREE
  358. ) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC;
  359. -- ----------------------------
  360. -- Records of t_ds_error_command
  361. -- ----------------------------
  362. -- ----------------------------
  363. -- Table structure for t_ds_process_definition
  364. -- ----------------------------
  365. DROP TABLE IF EXISTS `t_ds_process_definition`;
  366. CREATE TABLE `t_ds_process_definition` (
  367. `id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'self-increasing id',
  368. `code` bigint(20) NOT NULL COMMENT 'encoding',
  369. `name` varchar(255) DEFAULT NULL COMMENT 'process definition name',
  370. `version` int(11) DEFAULT '0' COMMENT 'process definition version',
  371. `description` text COMMENT 'description',
  372. `project_code` bigint(20) NOT NULL COMMENT 'project code',
  373. `release_state` tinyint(4) DEFAULT NULL COMMENT 'process definition release state:0:offline,1:online',
  374. `user_id` int(11) DEFAULT NULL COMMENT 'process definition creator id',
  375. `global_params` text COMMENT 'global parameters',
  376. `flag` tinyint(4) DEFAULT NULL COMMENT '0 not available, 1 available',
  377. `locations` text COMMENT 'Node location information',
  378. `warning_group_id` int(11) DEFAULT NULL COMMENT 'alert group id',
  379. `timeout` int(11) DEFAULT '0' COMMENT 'time out, unit: minute',
  380. `tenant_id` int(11) NOT NULL DEFAULT '-1' COMMENT 'tenant id',
  381. `create_time` datetime NOT NULL COMMENT 'create time',
  382. `update_time` datetime NOT NULL COMMENT 'update time',
  383. PRIMARY KEY (`id`,`code`),
  384. UNIQUE KEY `process_unique` (`name`,`project_code`) USING BTREE
  385. ) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;
  386. -- ----------------------------
  387. -- Records of t_ds_process_definition
  388. -- ----------------------------
  389. -- ----------------------------
  390. -- Table structure for t_ds_process_definition_log
  391. -- ----------------------------
  392. DROP TABLE IF EXISTS `t_ds_process_definition_log`;
  393. CREATE TABLE `t_ds_process_definition_log` (
  394. `id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'self-increasing id',
  395. `code` bigint(20) NOT NULL COMMENT 'encoding',
  396. `name` varchar(200) DEFAULT NULL COMMENT 'process definition name',
  397. `version` int(11) DEFAULT '0' COMMENT 'process definition version',
  398. `description` text COMMENT 'description',
  399. `project_code` bigint(20) NOT NULL COMMENT 'project code',
  400. `release_state` tinyint(4) DEFAULT NULL COMMENT 'process definition release state:0:offline,1:online',
  401. `user_id` int(11) DEFAULT NULL COMMENT 'process definition creator id',
  402. `global_params` text COMMENT 'global parameters',
  403. `flag` tinyint(4) DEFAULT NULL COMMENT '0 not available, 1 available',
  404. `locations` text COMMENT 'Node location information',
  405. `warning_group_id` int(11) DEFAULT NULL COMMENT 'alert group id',
  406. `timeout` int(11) DEFAULT '0' COMMENT 'time out,unit: minute',
  407. `tenant_id` int(11) NOT NULL DEFAULT '-1' COMMENT 'tenant id',
  408. `operator` int(11) DEFAULT NULL COMMENT 'operator user id',
  409. `operate_time` datetime DEFAULT NULL COMMENT 'operate time',
  410. `create_time` datetime NOT NULL COMMENT 'create time',
  411. `update_time` datetime NOT NULL COMMENT 'update time',
  412. PRIMARY KEY (`id`)
  413. ) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;
  414. -- ----------------------------
  415. -- Table structure for t_ds_task_definition
  416. -- ----------------------------
  417. DROP TABLE IF EXISTS `t_ds_task_definition`;
  418. CREATE TABLE `t_ds_task_definition` (
  419. `id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'self-increasing id',
  420. `code` bigint(20) NOT NULL COMMENT 'encoding',
  421. `name` varchar(200) DEFAULT NULL COMMENT 'task definition name',
  422. `version` int(11) DEFAULT '0' COMMENT 'task definition version',
  423. `description` text COMMENT 'description',
  424. `project_code` bigint(20) NOT NULL COMMENT 'project code',
  425. `user_id` int(11) DEFAULT NULL COMMENT 'task definition creator id',
  426. `task_type` varchar(50) NOT NULL COMMENT 'task type',
  427. `task_params` longtext COMMENT 'job custom parameters',
  428. `flag` tinyint(2) DEFAULT NULL COMMENT '0 not available, 1 available',
  429. `task_priority` tinyint(4) DEFAULT NULL COMMENT 'job priority',
  430. `worker_group` varchar(200) DEFAULT NULL COMMENT 'worker grouping',
  431. `environment_code` bigint(20) DEFAULT '-1' COMMENT 'environment code',
  432. `fail_retry_times` int(11) DEFAULT NULL COMMENT 'number of failed retries',
  433. `fail_retry_interval` int(11) DEFAULT NULL COMMENT 'failed retry interval',
  434. `timeout_flag` tinyint(2) DEFAULT '0' COMMENT 'timeout flag:0 close, 1 open',
  435. `timeout_notify_strategy` tinyint(4) DEFAULT NULL COMMENT 'timeout notification policy: 0 warning, 1 fail',
  436. `timeout` int(11) DEFAULT '0' COMMENT 'timeout length,unit: minute',
  437. `delay_time` int(11) DEFAULT '0' COMMENT 'delay execution time,unit: minute',
  438. `resource_ids` text COMMENT 'resource id, separated by comma',
  439. `create_time` datetime NOT NULL COMMENT 'create time',
  440. `update_time` datetime NOT NULL COMMENT 'update time',
  441. PRIMARY KEY (`id`,`code`)
  442. ) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;
  443. -- ----------------------------
  444. -- Table structure for t_ds_task_definition_log
  445. -- ----------------------------
  446. DROP TABLE IF EXISTS `t_ds_task_definition_log`;
  447. CREATE TABLE `t_ds_task_definition_log` (
  448. `id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'self-increasing id',
  449. `code` bigint(20) NOT NULL COMMENT 'encoding',
  450. `name` varchar(200) DEFAULT NULL COMMENT 'task definition name',
  451. `version` int(11) DEFAULT '0' COMMENT 'task definition version',
  452. `description` text COMMENT 'description',
  453. `project_code` bigint(20) NOT NULL COMMENT 'project code',
  454. `user_id` int(11) DEFAULT NULL COMMENT 'task definition creator id',
  455. `task_type` varchar(50) NOT NULL COMMENT 'task type',
  456. `task_params` text COMMENT 'job custom parameters',
  457. `flag` tinyint(2) DEFAULT NULL COMMENT '0 not available, 1 available',
  458. `task_priority` tinyint(4) DEFAULT NULL COMMENT 'job priority',
  459. `worker_group` varchar(200) DEFAULT NULL COMMENT 'worker grouping',
  460. `environment_code` bigint(20) DEFAULT '-1' COMMENT 'environment code',
  461. `fail_retry_times` int(11) DEFAULT NULL COMMENT 'number of failed retries',
  462. `fail_retry_interval` int(11) DEFAULT NULL COMMENT 'failed retry interval',
  463. `timeout_flag` tinyint(2) DEFAULT '0' COMMENT 'timeout flag:0 close, 1 open',
  464. `timeout_notify_strategy` tinyint(4) DEFAULT NULL COMMENT 'timeout notification policy: 0 warning, 1 fail',
  465. `timeout` int(11) DEFAULT '0' COMMENT 'timeout length,unit: minute',
  466. `delay_time` int(11) DEFAULT '0' COMMENT 'delay execution time,unit: minute',
  467. `resource_ids` text DEFAULT NULL COMMENT 'resource id, separated by comma',
  468. `operator` int(11) DEFAULT NULL COMMENT 'operator user id',
  469. `operate_time` datetime DEFAULT NULL COMMENT 'operate time',
  470. `create_time` datetime NOT NULL COMMENT 'create time',
  471. `update_time` datetime NOT NULL COMMENT 'update time',
  472. PRIMARY KEY (`id`)
  473. ) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;
  474. -- ----------------------------
  475. -- Table structure for t_ds_process_task_relation
  476. -- ----------------------------
  477. DROP TABLE IF EXISTS `t_ds_process_task_relation`;
  478. CREATE TABLE `t_ds_process_task_relation` (
  479. `id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'self-increasing id',
  480. `name` varchar(200) DEFAULT NULL COMMENT 'relation name',
  481. `project_code` bigint(20) NOT NULL COMMENT 'project code',
  482. `process_definition_code` bigint(20) NOT NULL COMMENT 'process code',
  483. `process_definition_version` int(11) NOT NULL COMMENT 'process version',
  484. `pre_task_code` bigint(20) NOT NULL COMMENT 'pre task code',
  485. `pre_task_version` int(11) NOT NULL COMMENT 'pre task version',
  486. `post_task_code` bigint(20) NOT NULL COMMENT 'post task code',
  487. `post_task_version` int(11) NOT NULL COMMENT 'post task version',
  488. `condition_type` tinyint(2) DEFAULT NULL COMMENT 'condition type : 0 none, 1 judge 2 delay',
  489. `condition_params` text COMMENT 'condition params(json)',
  490. `create_time` datetime NOT NULL COMMENT 'create time',
  491. `update_time` datetime NOT NULL COMMENT 'update time',
  492. PRIMARY KEY (`id`)
  493. ) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;
  494. -- ----------------------------
  495. -- Table structure for t_ds_process_task_relation_log
  496. -- ----------------------------
  497. DROP TABLE IF EXISTS `t_ds_process_task_relation_log`;
  498. CREATE TABLE `t_ds_process_task_relation_log` (
  499. `id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'self-increasing id',
  500. `name` varchar(200) DEFAULT NULL COMMENT 'relation name',
  501. `project_code` bigint(20) NOT NULL COMMENT 'project code',
  502. `process_definition_code` bigint(20) NOT NULL COMMENT 'process code',
  503. `process_definition_version` int(11) NOT NULL COMMENT 'process version',
  504. `pre_task_code` bigint(20) NOT NULL COMMENT 'pre task code',
  505. `pre_task_version` int(11) NOT NULL COMMENT 'pre task version',
  506. `post_task_code` bigint(20) NOT NULL COMMENT 'post task code',
  507. `post_task_version` int(11) NOT NULL COMMENT 'post task version',
  508. `condition_type` tinyint(2) DEFAULT NULL COMMENT 'condition type : 0 none, 1 judge 2 delay',
  509. `condition_params` text COMMENT 'condition params(json)',
  510. `operator` int(11) DEFAULT NULL COMMENT 'operator user id',
  511. `operate_time` datetime DEFAULT NULL COMMENT 'operate time',
  512. `create_time` datetime NOT NULL COMMENT 'create time',
  513. `update_time` datetime NOT NULL COMMENT 'update time',
  514. PRIMARY KEY (`id`)
  515. ) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;
  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. `id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'key',
  522. `name` varchar(255) DEFAULT NULL COMMENT 'process instance name',
  523. `process_definition_code` bigint(20) NOT NULL COMMENT 'process definition code',
  524. `process_definition_version` int(11) DEFAULT '0' COMMENT 'process definition version',
  525. `state` tinyint(4) DEFAULT NULL COMMENT 'process instance Status: 0 commit succeeded, 1 running, 2 prepare to pause, 3 pause, 4 prepare to stop, 5 stop, 6 fail, 7 succeed, 8 need fault tolerance, 9 kill, 10 wait for thread, 11 wait for dependency to complete',
  526. `recovery` tinyint(4) DEFAULT NULL COMMENT 'process instance failover flag:0:normal,1:failover instance',
  527. `start_time` datetime DEFAULT NULL COMMENT 'process instance start time',
  528. `end_time` datetime DEFAULT NULL COMMENT 'process instance end time',
  529. `run_times` int(11) DEFAULT NULL COMMENT 'process instance run times',
  530. `host` varchar(135) DEFAULT NULL COMMENT 'process instance host',
  531. `command_type` tinyint(4) DEFAULT NULL COMMENT 'command type',
  532. `command_param` text COMMENT 'json command parameters',
  533. `task_depend_type` tinyint(4) DEFAULT NULL COMMENT 'task depend type. 0: only current node,1:before the node,2:later nodes',
  534. `max_try_times` tinyint(4) DEFAULT '0' COMMENT 'max try times',
  535. `failure_strategy` tinyint(4) DEFAULT '0' COMMENT 'failure strategy. 0:end the process when node failed,1:continue running the other nodes when node failed',
  536. `warning_type` tinyint(4) DEFAULT '0' COMMENT 'warning type. 0:no warning,1:warning if process success,2:warning if process failed,3:warning if success',
  537. `warning_group_id` int(11) DEFAULT NULL COMMENT 'warning group id',
  538. `schedule_time` datetime DEFAULT NULL COMMENT 'schedule time',
  539. `command_start_time` datetime DEFAULT NULL COMMENT 'command start time',
  540. `global_params` text COMMENT 'global parameters',
  541. `flag` tinyint(4) DEFAULT '1' COMMENT 'flag',
  542. `update_time` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  543. `is_sub_process` int(11) DEFAULT '0' COMMENT 'flag, whether the process is sub process',
  544. `executor_id` int(11) NOT NULL COMMENT 'executor id',
  545. `history_cmd` text COMMENT 'history commands of process instance operation',
  546. `process_instance_priority` int(11) DEFAULT NULL COMMENT 'process instance priority. 0 Highest,1 High,2 Medium,3 Low,4 Lowest',
  547. `worker_group` varchar(64) DEFAULT NULL COMMENT 'worker group id',
  548. `environment_code` bigint(20) DEFAULT '-1' COMMENT 'environment code',
  549. `timeout` int(11) DEFAULT '0' COMMENT 'time out',
  550. `tenant_id` int(11) NOT NULL DEFAULT '-1' COMMENT 'tenant id',
  551. `var_pool` longtext COMMENT 'var_pool',
  552. `dry_run` tinyint(4) DEFAULT '0' COMMENT 'dry run flag:0 normal, 1 dry run',
  553. PRIMARY KEY (`id`),
  554. KEY `process_instance_index` (`process_definition_code`,`id`) USING BTREE,
  555. KEY `start_time_index` (`start_time`) USING BTREE
  556. ) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;
  557. -- ----------------------------
  558. -- Records of t_ds_process_instance
  559. -- ----------------------------
  560. -- ----------------------------
  561. -- Table structure for t_ds_project
  562. -- ----------------------------
  563. DROP TABLE IF EXISTS `t_ds_project`;
  564. CREATE TABLE `t_ds_project` (
  565. `id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'key',
  566. `name` varchar(100) DEFAULT NULL COMMENT 'project name',
  567. `code` bigint(20) NOT NULL COMMENT 'encoding',
  568. `description` varchar(200) DEFAULT NULL,
  569. `user_id` int(11) DEFAULT NULL COMMENT 'creator id',
  570. `flag` tinyint(4) DEFAULT '1' COMMENT '0 not available, 1 available',
  571. `create_time` datetime NOT NULL COMMENT 'create time',
  572. `update_time` datetime DEFAULT NULL COMMENT 'update time',
  573. PRIMARY KEY (`id`),
  574. KEY `user_id_index` (`user_id`) USING BTREE
  575. ) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;
  576. -- ----------------------------
  577. -- Records of t_ds_project
  578. -- ----------------------------
  579. -- ----------------------------
  580. -- Table structure for t_ds_queue
  581. -- ----------------------------
  582. DROP TABLE IF EXISTS `t_ds_queue`;
  583. CREATE TABLE `t_ds_queue` (
  584. `id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'key',
  585. `queue_name` varchar(64) DEFAULT NULL COMMENT 'queue name',
  586. `queue` varchar(64) DEFAULT NULL COMMENT 'yarn queue name',
  587. `create_time` datetime DEFAULT NULL COMMENT 'create time',
  588. `update_time` datetime DEFAULT NULL COMMENT 'update time',
  589. PRIMARY KEY (`id`)
  590. ) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;
  591. -- ----------------------------
  592. -- Records of t_ds_queue
  593. -- ----------------------------
  594. INSERT INTO `t_ds_queue` VALUES ('1', 'default', 'default', null, null);
  595. -- ----------------------------
  596. -- Table structure for t_ds_relation_datasource_user
  597. -- ----------------------------
  598. DROP TABLE IF EXISTS `t_ds_relation_datasource_user`;
  599. CREATE TABLE `t_ds_relation_datasource_user` (
  600. `id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'key',
  601. `user_id` int(11) NOT NULL COMMENT 'user id',
  602. `datasource_id` int(11) DEFAULT NULL COMMENT 'data source id',
  603. `perm` int(11) DEFAULT '1' COMMENT 'limits of authority',
  604. `create_time` datetime DEFAULT NULL COMMENT 'create time',
  605. `update_time` datetime DEFAULT NULL COMMENT 'update time',
  606. PRIMARY KEY (`id`)
  607. ) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;
  608. -- ----------------------------
  609. -- Records of t_ds_relation_datasource_user
  610. -- ----------------------------
  611. -- ----------------------------
  612. -- Table structure for t_ds_relation_process_instance
  613. -- ----------------------------
  614. DROP TABLE IF EXISTS `t_ds_relation_process_instance`;
  615. CREATE TABLE `t_ds_relation_process_instance` (
  616. `id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'key',
  617. `parent_process_instance_id` int(11) DEFAULT NULL COMMENT 'parent process instance id',
  618. `parent_task_instance_id` int(11) DEFAULT NULL COMMENT 'parent process instance id',
  619. `process_instance_id` int(11) DEFAULT NULL COMMENT 'child process instance id',
  620. PRIMARY KEY (`id`)
  621. ) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;
  622. -- ----------------------------
  623. -- Records of t_ds_relation_process_instance
  624. -- ----------------------------
  625. -- ----------------------------
  626. -- Table structure for t_ds_relation_project_user
  627. -- ----------------------------
  628. DROP TABLE IF EXISTS `t_ds_relation_project_user`;
  629. CREATE TABLE `t_ds_relation_project_user` (
  630. `id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'key',
  631. `user_id` int(11) NOT NULL COMMENT 'user id',
  632. `project_id` int(11) DEFAULT NULL COMMENT 'project id',
  633. `perm` int(11) DEFAULT '1' COMMENT 'limits of authority',
  634. `create_time` datetime DEFAULT NULL COMMENT 'create time',
  635. `update_time` datetime DEFAULT NULL COMMENT 'update time',
  636. PRIMARY KEY (`id`),
  637. KEY `user_id_index` (`user_id`) USING BTREE
  638. ) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;
  639. -- ----------------------------
  640. -- Records of t_ds_relation_project_user
  641. -- ----------------------------
  642. -- ----------------------------
  643. -- Table structure for t_ds_relation_resources_user
  644. -- ----------------------------
  645. DROP TABLE IF EXISTS `t_ds_relation_resources_user`;
  646. CREATE TABLE `t_ds_relation_resources_user` (
  647. `id` int(11) NOT NULL AUTO_INCREMENT,
  648. `user_id` int(11) NOT NULL COMMENT 'user id',
  649. `resources_id` int(11) DEFAULT NULL COMMENT 'resource id',
  650. `perm` int(11) DEFAULT '1' COMMENT 'limits of authority',
  651. `create_time` datetime DEFAULT NULL COMMENT 'create time',
  652. `update_time` datetime DEFAULT NULL COMMENT 'update time',
  653. PRIMARY KEY (`id`)
  654. ) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;
  655. -- ----------------------------
  656. -- Records of t_ds_relation_resources_user
  657. -- ----------------------------
  658. -- ----------------------------
  659. -- Table structure for t_ds_relation_udfs_user
  660. -- ----------------------------
  661. DROP TABLE IF EXISTS `t_ds_relation_udfs_user`;
  662. CREATE TABLE `t_ds_relation_udfs_user` (
  663. `id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'key',
  664. `user_id` int(11) NOT NULL COMMENT 'userid',
  665. `udf_id` int(11) DEFAULT NULL COMMENT 'udf id',
  666. `perm` int(11) DEFAULT '1' COMMENT 'limits of authority',
  667. `create_time` datetime DEFAULT NULL COMMENT 'create time',
  668. `update_time` datetime DEFAULT NULL COMMENT 'update time',
  669. PRIMARY KEY (`id`)
  670. ) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;
  671. -- ----------------------------
  672. -- Table structure for t_ds_resources
  673. -- ----------------------------
  674. DROP TABLE IF EXISTS `t_ds_resources`;
  675. CREATE TABLE `t_ds_resources` (
  676. `id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'key',
  677. `alias` varchar(64) DEFAULT NULL COMMENT 'alias',
  678. `file_name` varchar(64) DEFAULT NULL COMMENT 'file name',
  679. `description` varchar(255) DEFAULT NULL,
  680. `user_id` int(11) DEFAULT NULL COMMENT 'user id',
  681. `type` tinyint(4) DEFAULT NULL COMMENT 'resource type,0:FILE,1:UDF',
  682. `size` bigint(20) DEFAULT NULL COMMENT 'resource size',
  683. `create_time` datetime DEFAULT NULL COMMENT 'create time',
  684. `update_time` datetime DEFAULT NULL COMMENT 'update time',
  685. `pid` int(11) DEFAULT NULL,
  686. `full_name` varchar(64) DEFAULT NULL,
  687. `is_directory` tinyint(4) DEFAULT NULL,
  688. PRIMARY KEY (`id`),
  689. UNIQUE KEY `t_ds_resources_un` (`full_name`,`type`)
  690. ) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;
  691. -- ----------------------------
  692. -- Records of t_ds_resources
  693. -- ----------------------------
  694. -- ----------------------------
  695. -- Table structure for t_ds_schedules
  696. -- ----------------------------
  697. DROP TABLE IF EXISTS `t_ds_schedules`;
  698. CREATE TABLE `t_ds_schedules` (
  699. `id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'key',
  700. `process_definition_code` bigint(20) NOT NULL COMMENT 'process definition code',
  701. `start_time` datetime NOT NULL COMMENT 'start time',
  702. `end_time` datetime NOT NULL COMMENT 'end time',
  703. `timezone_id` varchar(40) DEFAULT NULL COMMENT 'schedule timezone id',
  704. `crontab` varchar(255) NOT NULL COMMENT 'crontab description',
  705. `failure_strategy` tinyint(4) NOT NULL COMMENT 'failure strategy. 0:end,1:continue',
  706. `user_id` int(11) NOT NULL COMMENT 'user id',
  707. `release_state` tinyint(4) NOT NULL COMMENT 'release state. 0:offline,1:online ',
  708. `warning_type` tinyint(4) NOT NULL COMMENT 'Alarm type: 0 is not sent, 1 process is sent successfully, 2 process is sent failed, 3 process is sent successfully and all failures are sent',
  709. `warning_group_id` int(11) DEFAULT NULL COMMENT 'alert group id',
  710. `process_instance_priority` int(11) DEFAULT NULL COMMENT 'process instance priority:0 Highest,1 High,2 Medium,3 Low,4 Lowest',
  711. `worker_group` varchar(64) DEFAULT '' COMMENT 'worker group id',
  712. `environment_code` bigint(20) DEFAULT '-1' COMMENT 'environment code',
  713. `create_time` datetime NOT NULL COMMENT 'create time',
  714. `update_time` datetime NOT NULL COMMENT 'update time',
  715. PRIMARY KEY (`id`)
  716. ) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;
  717. -- ----------------------------
  718. -- Records of t_ds_schedules
  719. -- ----------------------------
  720. -- ----------------------------
  721. -- Table structure for t_ds_session
  722. -- ----------------------------
  723. DROP TABLE IF EXISTS `t_ds_session`;
  724. CREATE TABLE `t_ds_session` (
  725. `id` varchar(64) NOT NULL COMMENT 'key',
  726. `user_id` int(11) DEFAULT NULL COMMENT 'user id',
  727. `ip` varchar(45) DEFAULT NULL COMMENT 'ip',
  728. `last_login_time` datetime DEFAULT NULL COMMENT 'last login time',
  729. PRIMARY KEY (`id`)
  730. ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
  731. -- ----------------------------
  732. -- Records of t_ds_session
  733. -- ----------------------------
  734. -- ----------------------------
  735. -- Table structure for t_ds_task_instance
  736. -- ----------------------------
  737. DROP TABLE IF EXISTS `t_ds_task_instance`;
  738. CREATE TABLE `t_ds_task_instance` (
  739. `id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'key',
  740. `name` varchar(255) DEFAULT NULL COMMENT 'task name',
  741. `task_type` varchar(50) NOT NULL COMMENT 'task type',
  742. `task_code` bigint(20) NOT NULL COMMENT 'task definition code',
  743. `task_definition_version` int(11) DEFAULT '0' COMMENT 'task definition version',
  744. `process_instance_id` int(11) DEFAULT NULL COMMENT 'process instance id',
  745. `state` tinyint(4) DEFAULT NULL COMMENT 'Status: 0 commit succeeded, 1 running, 2 prepare to pause, 3 pause, 4 prepare to stop, 5 stop, 6 fail, 7 succeed, 8 need fault tolerance, 9 kill, 10 wait for thread, 11 wait for dependency to complete',
  746. `submit_time` datetime DEFAULT NULL COMMENT 'task submit time',
  747. `start_time` datetime DEFAULT NULL COMMENT 'task start time',
  748. `end_time` datetime DEFAULT NULL COMMENT 'task end time',
  749. `host` varchar(135) DEFAULT NULL COMMENT 'host of task running on',
  750. `execute_path` varchar(200) DEFAULT NULL COMMENT 'task execute path in the host',
  751. `log_path` varchar(200) DEFAULT NULL COMMENT 'task log path',
  752. `alert_flag` tinyint(4) DEFAULT NULL COMMENT 'whether alert',
  753. `retry_times` int(4) DEFAULT '0' COMMENT 'task retry times',
  754. `pid` int(4) DEFAULT NULL COMMENT 'pid of task',
  755. `app_link` text COMMENT 'yarn app id',
  756. `task_params` text COMMENT 'job custom parameters',
  757. `flag` tinyint(4) DEFAULT '1' COMMENT '0 not available, 1 available',
  758. `retry_interval` int(4) DEFAULT NULL COMMENT 'retry interval when task failed ',
  759. `max_retry_times` int(2) DEFAULT NULL COMMENT 'max retry times',
  760. `task_instance_priority` int(11) DEFAULT NULL COMMENT 'task instance priority:0 Highest,1 High,2 Medium,3 Low,4 Lowest',
  761. `worker_group` varchar(64) DEFAULT NULL COMMENT 'worker group id',
  762. `environment_code` bigint(20) DEFAULT '-1' COMMENT 'environment code',
  763. `environment_config` text COMMENT 'this config contains many environment variables config',
  764. `executor_id` int(11) DEFAULT NULL,
  765. `first_submit_time` datetime DEFAULT NULL COMMENT 'task first submit time',
  766. `delay_time` int(4) DEFAULT '0' COMMENT 'task delay execution time',
  767. `var_pool` longtext COMMENT 'var_pool',
  768. `dry_run` tinyint(4) DEFAULT '0' COMMENT 'dry run flag: 0 normal, 1 dry run',
  769. PRIMARY KEY (`id`),
  770. KEY `process_instance_id` (`process_instance_id`) USING BTREE,
  771. CONSTRAINT `foreign_key_instance_id` FOREIGN KEY (`process_instance_id`) REFERENCES `t_ds_process_instance` (`id`) ON DELETE CASCADE
  772. ) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;
  773. -- ----------------------------
  774. -- Records of t_ds_task_instance
  775. -- ----------------------------
  776. -- ----------------------------
  777. -- Table structure for t_ds_tenant
  778. -- ----------------------------
  779. DROP TABLE IF EXISTS `t_ds_tenant`;
  780. CREATE TABLE `t_ds_tenant` (
  781. `id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'key',
  782. `tenant_code` varchar(64) DEFAULT NULL COMMENT 'tenant code',
  783. `description` varchar(255) DEFAULT NULL,
  784. `queue_id` int(11) DEFAULT NULL COMMENT 'queue id',
  785. `create_time` datetime DEFAULT NULL COMMENT 'create time',
  786. `update_time` datetime DEFAULT NULL COMMENT 'update time',
  787. PRIMARY KEY (`id`)
  788. ) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;
  789. -- ----------------------------
  790. -- Records of t_ds_tenant
  791. -- ----------------------------
  792. -- ----------------------------
  793. -- Table structure for t_ds_udfs
  794. -- ----------------------------
  795. DROP TABLE IF EXISTS `t_ds_udfs`;
  796. CREATE TABLE `t_ds_udfs` (
  797. `id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'key',
  798. `user_id` int(11) NOT NULL COMMENT 'user id',
  799. `func_name` varchar(100) NOT NULL COMMENT 'UDF function name',
  800. `class_name` varchar(255) NOT NULL COMMENT 'class of udf',
  801. `type` tinyint(4) NOT NULL COMMENT 'Udf function type',
  802. `arg_types` varchar(255) DEFAULT NULL COMMENT 'arguments types',
  803. `database` varchar(255) DEFAULT NULL COMMENT 'data base',
  804. `description` varchar(255) DEFAULT NULL,
  805. `resource_id` int(11) NOT NULL COMMENT 'resource id',
  806. `resource_name` varchar(255) NOT NULL COMMENT 'resource name',
  807. `create_time` datetime NOT NULL COMMENT 'create time',
  808. `update_time` datetime NOT NULL COMMENT 'update time',
  809. PRIMARY KEY (`id`)
  810. ) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;
  811. -- ----------------------------
  812. -- Records of t_ds_udfs
  813. -- ----------------------------
  814. -- ----------------------------
  815. -- Table structure for t_ds_user
  816. -- ----------------------------
  817. DROP TABLE IF EXISTS `t_ds_user`;
  818. CREATE TABLE `t_ds_user` (
  819. `id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'user id',
  820. `user_name` varchar(64) DEFAULT NULL COMMENT 'user name',
  821. `user_password` varchar(64) DEFAULT NULL COMMENT 'user password',
  822. `user_type` tinyint(4) DEFAULT NULL COMMENT 'user type, 0:administrator,1:ordinary user',
  823. `email` varchar(64) DEFAULT NULL COMMENT 'email',
  824. `phone` varchar(11) DEFAULT NULL COMMENT 'phone',
  825. `tenant_id` int(11) DEFAULT NULL COMMENT 'tenant id',
  826. `create_time` datetime DEFAULT NULL COMMENT 'create time',
  827. `update_time` datetime DEFAULT NULL COMMENT 'update time',
  828. `queue` varchar(64) DEFAULT NULL COMMENT 'queue',
  829. `state` tinyint(4) DEFAULT '1' COMMENT 'state 0:disable 1:enable',
  830. PRIMARY KEY (`id`),
  831. UNIQUE KEY `user_name_unique` (`user_name`)
  832. ) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;
  833. -- ----------------------------
  834. -- Records of t_ds_user
  835. -- ----------------------------
  836. -- ----------------------------
  837. -- Table structure for t_ds_worker_group
  838. -- ----------------------------
  839. DROP TABLE IF EXISTS `t_ds_worker_group`;
  840. CREATE TABLE `t_ds_worker_group` (
  841. `id` bigint(11) NOT NULL AUTO_INCREMENT COMMENT 'id',
  842. `name` varchar(255) NOT NULL COMMENT 'worker group name',
  843. `addr_list` text NULL DEFAULT NULL COMMENT 'worker addr list. split by [,]',
  844. `create_time` datetime NULL DEFAULT NULL COMMENT 'create time',
  845. `update_time` datetime NULL DEFAULT NULL COMMENT 'update time',
  846. PRIMARY KEY (`id`),
  847. UNIQUE KEY `name_unique` (`name`)
  848. ) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;
  849. -- ----------------------------
  850. -- Records of t_ds_worker_group
  851. -- ----------------------------
  852. -- ----------------------------
  853. -- Table structure for t_ds_version
  854. -- ----------------------------
  855. DROP TABLE IF EXISTS `t_ds_version`;
  856. CREATE TABLE `t_ds_version` (
  857. `id` int(11) NOT NULL AUTO_INCREMENT,
  858. `version` varchar(200) NOT NULL,
  859. PRIMARY KEY (`id`),
  860. UNIQUE KEY `version_UNIQUE` (`version`)
  861. ) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8 COMMENT='version';
  862. -- ----------------------------
  863. -- Records of t_ds_version
  864. -- ----------------------------
  865. INSERT INTO `t_ds_version` VALUES ('1', '1.4.0');
  866. -- ----------------------------
  867. -- Records of t_ds_alertgroup
  868. -- ----------------------------
  869. INSERT INTO `t_ds_alertgroup`(alert_instance_ids, create_user_id, group_name, description, create_time, update_time)
  870. VALUES ("1,2", 1, 'default admin warning group', 'default admin warning group', '2018-11-29 10:20:39', '2018-11-29 10:20:39');
  871. -- ----------------------------
  872. -- Records of t_ds_user
  873. -- ----------------------------
  874. INSERT INTO `t_ds_user`
  875. VALUES ('1', 'admin', '7ad2410b2f4c074479a8937a28a22b8f', '0', 'xxx@qq.com', '', '0', '2018-03-27 15:48:50', '2018-10-24 17:40:22', null, 1);
  876. -- ----------------------------
  877. -- Table structure for t_ds_plugin_define
  878. -- ----------------------------
  879. SET sql_mode=(SELECT REPLACE(@@sql_mode,'ONLY_FULL_GROUP_BY',''));
  880. DROP TABLE IF EXISTS `t_ds_plugin_define`;
  881. CREATE TABLE `t_ds_plugin_define` (
  882. `id` int NOT NULL AUTO_INCREMENT,
  883. `plugin_name` varchar(100) NOT NULL COMMENT 'the name of plugin eg: email',
  884. `plugin_type` varchar(100) NOT NULL COMMENT 'plugin type . alert=alert plugin, job=job plugin',
  885. `plugin_params` text COMMENT 'plugin params',
  886. `create_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  887. `update_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  888. PRIMARY KEY (`id`),
  889. UNIQUE KEY `t_ds_plugin_define_UN` (`plugin_name`,`plugin_type`)
  890. ) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8;
  891. -- ----------------------------
  892. -- Table structure for t_ds_alert_plugin_instance
  893. -- ----------------------------
  894. DROP TABLE IF EXISTS `t_ds_alert_plugin_instance`;
  895. CREATE TABLE `t_ds_alert_plugin_instance` (
  896. `id` int NOT NULL AUTO_INCREMENT,
  897. `plugin_define_id` int NOT NULL,
  898. `plugin_instance_params` text COMMENT 'plugin instance params. Also contain the params value which user input in web ui.',
  899. `create_time` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  900. `update_time` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  901. `instance_name` varchar(200) DEFAULT NULL COMMENT 'alert instance name',
  902. PRIMARY KEY (`id`)
  903. ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
  904. -- ----------------------------
  905. -- Table structure for t_ds_environment
  906. -- ----------------------------
  907. DROP TABLE IF EXISTS `t_ds_environment`;
  908. CREATE TABLE `t_ds_environment` (
  909. `id` bigint(11) NOT NULL AUTO_INCREMENT COMMENT 'id',
  910. `code` bigint(20) DEFAULT NULL COMMENT 'encoding',
  911. `name` varchar(100) NOT NULL COMMENT 'environment name',
  912. `config` text NULL DEFAULT NULL COMMENT 'this config contains many environment variables config',
  913. `description` text NULL DEFAULT NULL COMMENT 'the details',
  914. `operator` int(11) DEFAULT NULL COMMENT 'operator user id',
  915. `create_time` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  916. `update_time` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  917. PRIMARY KEY (`id`),
  918. UNIQUE KEY `environment_name_unique` (`name`),
  919. UNIQUE KEY `environment_code_unique` (`code`)
  920. ) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;
  921. -- ----------------------------
  922. -- Table structure for t_ds_environment_worker_group_relation
  923. -- ----------------------------
  924. DROP TABLE IF EXISTS `t_ds_environment_worker_group_relation`;
  925. CREATE TABLE `t_ds_environment_worker_group_relation` (
  926. `id` bigint(11) NOT NULL AUTO_INCREMENT COMMENT 'id',
  927. `environment_code` bigint(20) NOT NULL COMMENT 'environment code',
  928. `worker_group` varchar(255) NOT NULL COMMENT 'worker group id',
  929. `operator` int(11) DEFAULT NULL COMMENT 'operator user id',
  930. `create_time` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  931. `update_time` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  932. PRIMARY KEY (`id`),
  933. UNIQUE KEY `environment_worker_group_unique` (`environment_code`,`worker_group`)
  934. ) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;