dolphinscheduler_mysql.sql 47 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010
  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_id` int(11) DEFAULT NULL COMMENT 'process definition id',
  293. `command_param` text COMMENT 'json command parameters',
  294. `task_depend_type` tinyint(4) DEFAULT NULL COMMENT 'Node dependency type: 0 current node, 1 forward, 2 backward',
  295. `failure_strategy` tinyint(4) DEFAULT '0' COMMENT 'Failed policy: 0 end, 1 continue',
  296. `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',
  297. `warning_group_id` int(11) DEFAULT NULL COMMENT 'warning group',
  298. `schedule_time` datetime DEFAULT NULL COMMENT 'schedule time',
  299. `start_time` datetime DEFAULT NULL COMMENT 'start time',
  300. `executor_id` int(11) DEFAULT NULL COMMENT 'executor id',
  301. `update_time` datetime DEFAULT NULL COMMENT 'update time',
  302. `process_instance_priority` int(11) DEFAULT NULL COMMENT 'process instance priority: 0 Highest,1 High,2 Medium,3 Low,4 Lowest',
  303. `worker_group` varchar(64) COMMENT 'worker group',
  304. `environment_code` bigint(20) NOT NULL COMMENT 'environment code',
  305. PRIMARY KEY (`id`)
  306. ) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;
  307. -- ----------------------------
  308. -- Records of t_ds_command
  309. -- ----------------------------
  310. -- ----------------------------
  311. -- Table structure for t_ds_datasource
  312. -- ----------------------------
  313. DROP TABLE IF EXISTS `t_ds_datasource`;
  314. CREATE TABLE `t_ds_datasource` (
  315. `id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'key',
  316. `name` varchar(64) NOT NULL COMMENT 'data source name',
  317. `note` varchar(255) DEFAULT NULL COMMENT 'description',
  318. `type` tinyint(4) NOT NULL COMMENT 'data source type: 0:mysql,1:postgresql,2:hive,3:spark',
  319. `user_id` int(11) NOT NULL COMMENT 'the creator id',
  320. `connection_params` text NOT NULL COMMENT 'json connection params',
  321. `create_time` datetime NOT NULL COMMENT 'create time',
  322. `update_time` datetime DEFAULT NULL COMMENT 'update time',
  323. PRIMARY KEY (`id`),
  324. UNIQUE KEY `t_ds_datasource_name_un` (`name`, `type`)
  325. ) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;
  326. -- ----------------------------
  327. -- Records of t_ds_datasource
  328. -- ----------------------------
  329. -- ----------------------------
  330. -- Table structure for t_ds_error_command
  331. -- ----------------------------
  332. DROP TABLE IF EXISTS `t_ds_error_command`;
  333. CREATE TABLE `t_ds_error_command` (
  334. `id` int(11) NOT NULL COMMENT 'key',
  335. `command_type` tinyint(4) DEFAULT NULL COMMENT 'command type',
  336. `executor_id` int(11) DEFAULT NULL COMMENT 'executor id',
  337. `process_definition_id` int(11) DEFAULT NULL COMMENT 'process definition id',
  338. `command_param` text COMMENT 'json command parameters',
  339. `task_depend_type` tinyint(4) DEFAULT NULL COMMENT 'task depend type',
  340. `failure_strategy` tinyint(4) DEFAULT '0' COMMENT 'failure strategy',
  341. `warning_type` tinyint(4) DEFAULT '0' COMMENT 'warning type',
  342. `warning_group_id` int(11) DEFAULT NULL COMMENT 'warning group id',
  343. `schedule_time` datetime DEFAULT NULL COMMENT 'scheduler time',
  344. `start_time` datetime DEFAULT NULL COMMENT 'start time',
  345. `update_time` datetime DEFAULT NULL COMMENT 'update time',
  346. `process_instance_priority` int(11) DEFAULT NULL COMMENT 'process instance priority, 0 Highest,1 High,2 Medium,3 Low,4 Lowest',
  347. `worker_group` varchar(64) COMMENT 'worker group',
  348. `environment_code` bigint(20) NOT NULL COMMENT 'environment code',
  349. `message` text COMMENT 'message',
  350. PRIMARY KEY (`id`) USING BTREE
  351. ) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC;
  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. `id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'self-increasing id',
  361. `code` bigint(20) NOT NULL COMMENT 'encoding',
  362. `name` varchar(255) DEFAULT NULL COMMENT 'process definition name',
  363. `version` int(11) DEFAULT NULL COMMENT 'process definition version',
  364. `description` text COMMENT 'description',
  365. `project_code` bigint(20) NOT NULL COMMENT 'project code',
  366. `release_state` tinyint(4) DEFAULT NULL COMMENT 'process definition release state:0:offline,1:online',
  367. `user_id` int(11) DEFAULT NULL COMMENT 'process definition creator id',
  368. `global_params` text COMMENT 'global parameters',
  369. `flag` tinyint(4) DEFAULT NULL COMMENT '0 not available, 1 available',
  370. `locations` text COMMENT 'Node location information',
  371. `connects` text COMMENT 'Node connection information',
  372. `warning_group_id` int(11) DEFAULT NULL COMMENT 'alert group id',
  373. `timeout` int(11) DEFAULT '0' COMMENT 'time out, unit: minute',
  374. `tenant_id` int(11) NOT NULL DEFAULT '-1' COMMENT 'tenant id',
  375. `create_time` datetime NOT NULL COMMENT 'create time',
  376. `update_time` datetime DEFAULT NULL COMMENT 'update time',
  377. PRIMARY KEY (`id`),
  378. UNIQUE KEY `process_unique` (`name`,`project_code`) USING BTREE,
  379. UNIQUE KEY `code_unique` (`code`)
  380. ) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;
  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. `id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'self-increasing id',
  390. `code` bigint(20) NOT NULL COMMENT 'encoding',
  391. `name` varchar(200) DEFAULT NULL COMMENT 'process definition name',
  392. `version` int(11) DEFAULT NULL COMMENT 'process definition version',
  393. `description` text COMMENT 'description',
  394. `project_code` bigint(20) NOT NULL COMMENT 'project code',
  395. `release_state` tinyint(4) DEFAULT NULL COMMENT 'process definition release state:0:offline,1:online',
  396. `user_id` int(11) DEFAULT NULL COMMENT 'process definition creator id',
  397. `global_params` text COMMENT 'global parameters',
  398. `flag` tinyint(4) DEFAULT NULL COMMENT '0 not available, 1 available',
  399. `locations` text COMMENT 'Node location information',
  400. `connects` text COMMENT 'Node connection information',
  401. `warning_group_id` int(11) DEFAULT NULL COMMENT 'alert group id',
  402. `timeout` int(11) DEFAULT '0' COMMENT 'time out,unit: minute',
  403. `tenant_id` int(11) NOT NULL DEFAULT '-1' COMMENT 'tenant id',
  404. `operator` int(11) DEFAULT NULL COMMENT 'operator user id',
  405. `operate_time` datetime DEFAULT NULL COMMENT 'operate time',
  406. `create_time` datetime NOT NULL COMMENT 'create time',
  407. `update_time` datetime DEFAULT NULL COMMENT 'update time',
  408. PRIMARY KEY (`id`)
  409. ) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;
  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. `id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'self-increasing id',
  416. `code` bigint(20) NOT NULL COMMENT 'encoding',
  417. `name` varchar(200) DEFAULT NULL COMMENT 'task definition name',
  418. `version` int(11) DEFAULT NULL COMMENT 'task definition version',
  419. `description` text COMMENT 'description',
  420. `project_code` bigint(20) NOT NULL COMMENT 'project code',
  421. `user_id` int(11) DEFAULT NULL COMMENT 'task definition creator id',
  422. `task_type` varchar(50) NOT NULL COMMENT 'task type',
  423. `task_params` longtext COMMENT 'job custom parameters',
  424. `flag` tinyint(2) DEFAULT NULL COMMENT '0 not available, 1 available',
  425. `task_priority` tinyint(4) DEFAULT NULL COMMENT 'job priority',
  426. `worker_group` varchar(200) DEFAULT NULL COMMENT 'worker grouping',
  427. `environment_code` bigint(20) NOT NULL COMMENT 'environment code',
  428. `fail_retry_times` int(11) DEFAULT NULL COMMENT 'number of failed retries',
  429. `fail_retry_interval` int(11) DEFAULT NULL COMMENT 'failed retry interval',
  430. `timeout_flag` tinyint(2) DEFAULT '0' COMMENT 'timeout flag:0 close, 1 open',
  431. `timeout_notify_strategy` tinyint(4) DEFAULT NULL COMMENT 'timeout notification policy: 0 warning, 1 fail',
  432. `timeout` int(11) DEFAULT '0' COMMENT 'timeout length,unit: minute',
  433. `delay_time` int(11) DEFAULT '0' COMMENT 'delay execution time,unit: minute',
  434. `resource_ids` varchar(255) DEFAULT NULL COMMENT 'resource id, separated by comma',
  435. `create_time` datetime NOT NULL COMMENT 'create time',
  436. `update_time` datetime DEFAULT NULL COMMENT 'update time',
  437. PRIMARY KEY (`id`,`code`),
  438. UNIQUE KEY `task_unique` (`name`,`project_code`) USING BTREE
  439. ) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;
  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. `id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'self-increasing id',
  446. `code` bigint(20) NOT NULL COMMENT 'encoding',
  447. `name` varchar(200) DEFAULT NULL COMMENT 'task definition name',
  448. `version` int(11) DEFAULT NULL COMMENT 'task definition version',
  449. `description` text COMMENT 'description',
  450. `project_code` bigint(20) NOT NULL COMMENT 'project code',
  451. `user_id` int(11) DEFAULT NULL COMMENT 'task definition creator id',
  452. `task_type` varchar(50) NOT NULL COMMENT 'task type',
  453. `task_params` text COMMENT 'job custom parameters',
  454. `flag` tinyint(2) DEFAULT NULL COMMENT '0 not available, 1 available',
  455. `task_priority` tinyint(4) DEFAULT NULL COMMENT 'job priority',
  456. `worker_group` varchar(200) DEFAULT NULL COMMENT 'worker grouping',
  457. `environment_code` bigint(20) NOT NULL COMMENT 'environment code',
  458. `fail_retry_times` int(11) DEFAULT NULL COMMENT 'number of failed retries',
  459. `fail_retry_interval` int(11) DEFAULT NULL COMMENT 'failed retry interval',
  460. `timeout_flag` tinyint(2) DEFAULT '0' COMMENT 'timeout flag:0 close, 1 open',
  461. `timeout_notify_strategy` tinyint(4) DEFAULT NULL COMMENT 'timeout notification policy: 0 warning, 1 fail',
  462. `timeout` int(11) DEFAULT '0' COMMENT 'timeout length,unit: minute',
  463. `delay_time` int(11) DEFAULT '0' COMMENT 'delay execution time,unit: minute',
  464. `resource_ids` varchar(255) DEFAULT NULL COMMENT 'resource id, separated by comma',
  465. `operator` int(11) DEFAULT NULL COMMENT 'operator user id',
  466. `operate_time` datetime DEFAULT NULL COMMENT 'operate time',
  467. `create_time` datetime NOT NULL COMMENT 'create time',
  468. `update_time` datetime DEFAULT NULL COMMENT 'update time',
  469. PRIMARY KEY (`id`)
  470. ) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;
  471. -- ----------------------------
  472. -- Table structure for t_ds_process_task_relation
  473. -- ----------------------------
  474. DROP TABLE IF EXISTS `t_ds_process_task_relation`;
  475. CREATE TABLE `t_ds_process_task_relation` (
  476. `id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'self-increasing id',
  477. `name` varchar(200) DEFAULT NULL COMMENT 'relation name',
  478. `process_definition_version` int(11) DEFAULT NULL COMMENT 'process version',
  479. `project_code` bigint(20) NOT NULL COMMENT 'project code',
  480. `process_definition_code` bigint(20) NOT NULL COMMENT 'process code',
  481. `pre_task_code` bigint(20) NOT NULL COMMENT 'pre task code',
  482. `pre_task_version` int(11) NOT NULL COMMENT 'pre task version',
  483. `post_task_code` bigint(20) NOT NULL COMMENT 'post task code',
  484. `post_task_version` int(11) NOT NULL COMMENT 'post task version',
  485. `condition_type` tinyint(2) DEFAULT NULL COMMENT 'condition type : 0 none, 1 judge 2 delay',
  486. `condition_params` text COMMENT 'condition params(json)',
  487. `create_time` datetime NOT NULL COMMENT 'create time',
  488. `update_time` datetime DEFAULT NULL COMMENT 'update time',
  489. PRIMARY KEY (`id`)
  490. ) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;
  491. -- ----------------------------
  492. -- Table structure for t_ds_process_task_relation_log
  493. -- ----------------------------
  494. DROP TABLE IF EXISTS `t_ds_process_task_relation_log`;
  495. CREATE TABLE `t_ds_process_task_relation_log` (
  496. `id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'self-increasing id',
  497. `name` varchar(200) DEFAULT NULL COMMENT 'relation name',
  498. `process_definition_version` int(11) DEFAULT NULL COMMENT 'process version',
  499. `project_code` bigint(20) NOT NULL COMMENT 'project code',
  500. `process_definition_code` bigint(20) NOT NULL COMMENT 'process code',
  501. `pre_task_code` bigint(20) NOT NULL COMMENT 'pre task code',
  502. `pre_task_version` int(11) NOT NULL COMMENT 'pre task version',
  503. `post_task_code` bigint(20) NOT NULL COMMENT 'post task code',
  504. `post_task_version` int(11) NOT NULL COMMENT 'post task version',
  505. `condition_type` tinyint(2) DEFAULT NULL COMMENT 'condition type : 0 none, 1 judge 2 delay',
  506. `condition_params` text COMMENT 'condition params(json)',
  507. `operator` int(11) DEFAULT NULL COMMENT 'operator user id',
  508. `operate_time` datetime DEFAULT NULL COMMENT 'operate time',
  509. `create_time` datetime NOT NULL COMMENT 'create time',
  510. `update_time` datetime DEFAULT NULL COMMENT 'update time',
  511. PRIMARY KEY (`id`)
  512. ) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;
  513. -- ----------------------------
  514. -- Table structure for t_ds_process_instance
  515. -- ----------------------------
  516. DROP TABLE IF EXISTS `t_ds_process_instance`;
  517. CREATE TABLE `t_ds_process_instance` (
  518. `id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'key',
  519. `name` varchar(255) DEFAULT NULL COMMENT 'process instance name',
  520. `process_definition_version` int(11) DEFAULT NULL COMMENT 'process definition version',
  521. `process_definition_code` bigint(20) not NULL COMMENT 'process definition code',
  522. `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',
  523. `recovery` tinyint(4) DEFAULT NULL COMMENT 'process instance failover flag:0:normal,1:failover instance',
  524. `start_time` datetime DEFAULT NULL COMMENT 'process instance start time',
  525. `end_time` datetime DEFAULT NULL COMMENT 'process instance end time',
  526. `run_times` int(11) DEFAULT NULL COMMENT 'process instance run times',
  527. `host` varchar(135) DEFAULT NULL COMMENT 'process instance host',
  528. `command_type` tinyint(4) DEFAULT NULL COMMENT 'command type',
  529. `command_param` text COMMENT 'json command parameters',
  530. `task_depend_type` tinyint(4) DEFAULT NULL COMMENT 'task depend type. 0: only current node,1:before the node,2:later nodes',
  531. `max_try_times` tinyint(4) DEFAULT '0' COMMENT 'max try times',
  532. `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',
  533. `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',
  534. `warning_group_id` int(11) DEFAULT NULL COMMENT 'warning group id',
  535. `schedule_time` datetime DEFAULT NULL COMMENT 'schedule time',
  536. `command_start_time` datetime DEFAULT NULL COMMENT 'command start time',
  537. `global_params` text COMMENT 'global parameters',
  538. `flag` tinyint(4) DEFAULT '1' COMMENT 'flag',
  539. `update_time` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  540. `is_sub_process` int(11) DEFAULT '0' COMMENT 'flag, whether the process is sub process',
  541. `executor_id` int(11) NOT NULL COMMENT 'executor id',
  542. `history_cmd` text COMMENT 'history commands of process instance operation',
  543. `process_instance_priority` int(11) DEFAULT NULL COMMENT 'process instance priority. 0 Highest,1 High,2 Medium,3 Low,4 Lowest',
  544. `worker_group` varchar(64) DEFAULT NULL COMMENT 'worker group id',
  545. `timeout` int(11) DEFAULT '0' COMMENT 'time out',
  546. `tenant_id` int(11) NOT NULL DEFAULT '-1' COMMENT 'tenant id',
  547. `var_pool` longtext COMMENT 'var_pool',
  548. PRIMARY KEY (`id`),
  549. KEY `process_instance_index` (`process_definition_code`,`id`) USING BTREE,
  550. KEY `start_time_index` (`start_time`) USING BTREE
  551. ) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;
  552. -- ----------------------------
  553. -- Records of t_ds_process_instance
  554. -- ----------------------------
  555. -- ----------------------------
  556. -- Table structure for t_ds_project
  557. -- ----------------------------
  558. DROP TABLE IF EXISTS `t_ds_project`;
  559. CREATE TABLE `t_ds_project` (
  560. `id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'key',
  561. `name` varchar(100) DEFAULT NULL COMMENT 'project name',
  562. `code` bigint(20) NOT NULL COMMENT 'encoding',
  563. `description` varchar(200) DEFAULT NULL,
  564. `user_id` int(11) DEFAULT NULL COMMENT 'creator id',
  565. `flag` tinyint(4) DEFAULT '1' COMMENT '0 not available, 1 available',
  566. `create_time` datetime NOT NULL COMMENT 'create time',
  567. `update_time` datetime DEFAULT NULL COMMENT 'update time',
  568. PRIMARY KEY (`id`),
  569. KEY `user_id_index` (`user_id`) USING BTREE
  570. ) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;
  571. -- ----------------------------
  572. -- Records of t_ds_project
  573. -- ----------------------------
  574. -- ----------------------------
  575. -- Table structure for t_ds_queue
  576. -- ----------------------------
  577. DROP TABLE IF EXISTS `t_ds_queue`;
  578. CREATE TABLE `t_ds_queue` (
  579. `id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'key',
  580. `queue_name` varchar(64) DEFAULT NULL COMMENT 'queue name',
  581. `queue` varchar(64) DEFAULT NULL COMMENT 'yarn queue name',
  582. `create_time` datetime DEFAULT NULL COMMENT 'create time',
  583. `update_time` datetime DEFAULT NULL COMMENT 'update time',
  584. PRIMARY KEY (`id`)
  585. ) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;
  586. -- ----------------------------
  587. -- Records of t_ds_queue
  588. -- ----------------------------
  589. INSERT INTO `t_ds_queue` VALUES ('1', 'default', 'default', null, null);
  590. -- ----------------------------
  591. -- Table structure for t_ds_relation_datasource_user
  592. -- ----------------------------
  593. DROP TABLE IF EXISTS `t_ds_relation_datasource_user`;
  594. CREATE TABLE `t_ds_relation_datasource_user` (
  595. `id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'key',
  596. `user_id` int(11) NOT NULL COMMENT 'user id',
  597. `datasource_id` int(11) DEFAULT NULL COMMENT 'data source id',
  598. `perm` int(11) DEFAULT '1' COMMENT 'limits of authority',
  599. `create_time` datetime DEFAULT NULL COMMENT 'create time',
  600. `update_time` datetime DEFAULT NULL COMMENT 'update time',
  601. PRIMARY KEY (`id`)
  602. ) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;
  603. -- ----------------------------
  604. -- Records of t_ds_relation_datasource_user
  605. -- ----------------------------
  606. -- ----------------------------
  607. -- Table structure for t_ds_relation_process_instance
  608. -- ----------------------------
  609. DROP TABLE IF EXISTS `t_ds_relation_process_instance`;
  610. CREATE TABLE `t_ds_relation_process_instance` (
  611. `id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'key',
  612. `parent_process_instance_id` int(11) DEFAULT NULL COMMENT 'parent process instance id',
  613. `parent_task_instance_id` int(11) DEFAULT NULL COMMENT 'parent process instance id',
  614. `process_instance_id` int(11) DEFAULT NULL COMMENT 'child process instance id',
  615. PRIMARY KEY (`id`)
  616. ) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;
  617. -- ----------------------------
  618. -- Records of t_ds_relation_process_instance
  619. -- ----------------------------
  620. -- ----------------------------
  621. -- Table structure for t_ds_relation_project_user
  622. -- ----------------------------
  623. DROP TABLE IF EXISTS `t_ds_relation_project_user`;
  624. CREATE TABLE `t_ds_relation_project_user` (
  625. `id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'key',
  626. `user_id` int(11) NOT NULL COMMENT 'user id',
  627. `project_id` int(11) DEFAULT NULL COMMENT 'project id',
  628. `perm` int(11) DEFAULT '1' COMMENT 'limits of authority',
  629. `create_time` datetime DEFAULT NULL COMMENT 'create time',
  630. `update_time` datetime DEFAULT NULL COMMENT 'update time',
  631. PRIMARY KEY (`id`),
  632. KEY `user_id_index` (`user_id`) USING BTREE
  633. ) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;
  634. -- ----------------------------
  635. -- Records of t_ds_relation_project_user
  636. -- ----------------------------
  637. -- ----------------------------
  638. -- Table structure for t_ds_relation_resources_user
  639. -- ----------------------------
  640. DROP TABLE IF EXISTS `t_ds_relation_resources_user`;
  641. CREATE TABLE `t_ds_relation_resources_user` (
  642. `id` int(11) NOT NULL AUTO_INCREMENT,
  643. `user_id` int(11) NOT NULL COMMENT 'user id',
  644. `resources_id` int(11) DEFAULT NULL COMMENT 'resource id',
  645. `perm` int(11) DEFAULT '1' COMMENT 'limits of authority',
  646. `create_time` datetime DEFAULT NULL COMMENT 'create time',
  647. `update_time` datetime DEFAULT NULL COMMENT 'update time',
  648. PRIMARY KEY (`id`)
  649. ) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;
  650. -- ----------------------------
  651. -- Records of t_ds_relation_resources_user
  652. -- ----------------------------
  653. -- ----------------------------
  654. -- Table structure for t_ds_relation_udfs_user
  655. -- ----------------------------
  656. DROP TABLE IF EXISTS `t_ds_relation_udfs_user`;
  657. CREATE TABLE `t_ds_relation_udfs_user` (
  658. `id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'key',
  659. `user_id` int(11) NOT NULL COMMENT 'userid',
  660. `udf_id` int(11) DEFAULT NULL COMMENT 'udf id',
  661. `perm` int(11) DEFAULT '1' COMMENT 'limits of authority',
  662. `create_time` datetime DEFAULT NULL COMMENT 'create time',
  663. `update_time` datetime DEFAULT NULL COMMENT 'update time',
  664. PRIMARY KEY (`id`)
  665. ) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;
  666. -- ----------------------------
  667. -- Table structure for t_ds_resources
  668. -- ----------------------------
  669. DROP TABLE IF EXISTS `t_ds_resources`;
  670. CREATE TABLE `t_ds_resources` (
  671. `id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'key',
  672. `alias` varchar(64) DEFAULT NULL COMMENT 'alias',
  673. `file_name` varchar(64) DEFAULT NULL COMMENT 'file name',
  674. `description` varchar(255) DEFAULT NULL,
  675. `user_id` int(11) DEFAULT NULL COMMENT 'user id',
  676. `type` tinyint(4) DEFAULT NULL COMMENT 'resource type,0:FILE,1:UDF',
  677. `size` bigint(20) DEFAULT NULL COMMENT 'resource size',
  678. `create_time` datetime DEFAULT NULL COMMENT 'create time',
  679. `update_time` datetime DEFAULT NULL COMMENT 'update time',
  680. `pid` int(11) DEFAULT NULL,
  681. `full_name` varchar(64) DEFAULT NULL,
  682. `is_directory` tinyint(4) DEFAULT NULL,
  683. PRIMARY KEY (`id`),
  684. UNIQUE KEY `t_ds_resources_un` (`full_name`,`type`)
  685. ) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;
  686. -- ----------------------------
  687. -- Records of t_ds_resources
  688. -- ----------------------------
  689. -- ----------------------------
  690. -- Table structure for t_ds_schedules
  691. -- ----------------------------
  692. DROP TABLE IF EXISTS `t_ds_schedules`;
  693. CREATE TABLE `t_ds_schedules` (
  694. `id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'key',
  695. `process_definition_id` int(11) NOT NULL COMMENT 'process definition id',
  696. `start_time` datetime NOT NULL COMMENT 'start time',
  697. `end_time` datetime NOT NULL COMMENT 'end time',
  698. `timezone_id` varchar(40) DEFAULT NULL COMMENT 'timezoneId',
  699. `crontab` varchar(255) NOT NULL COMMENT 'crontab description',
  700. `failure_strategy` tinyint(4) NOT NULL COMMENT 'failure strategy. 0:end,1:continue',
  701. `user_id` int(11) NOT NULL COMMENT 'user id',
  702. `release_state` tinyint(4) NOT NULL COMMENT 'release state. 0:offline,1:online ',
  703. `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',
  704. `warning_group_id` int(11) DEFAULT NULL COMMENT 'alert group id',
  705. `process_instance_priority` int(11) DEFAULT NULL COMMENT 'process instance priority:0 Highest,1 High,2 Medium,3 Low,4 Lowest',
  706. `worker_group` varchar(64) DEFAULT '' COMMENT 'worker group id',
  707. `environment_code` bigint(20) NOT NULL COMMENT 'environment code',
  708. `create_time` datetime NOT NULL COMMENT 'create time',
  709. `update_time` datetime NOT NULL COMMENT 'update time',
  710. PRIMARY KEY (`id`)
  711. ) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;
  712. -- ----------------------------
  713. -- Records of t_ds_schedules
  714. -- ----------------------------
  715. -- ----------------------------
  716. -- Table structure for t_ds_session
  717. -- ----------------------------
  718. DROP TABLE IF EXISTS `t_ds_session`;
  719. CREATE TABLE `t_ds_session` (
  720. `id` varchar(64) NOT NULL COMMENT 'key',
  721. `user_id` int(11) DEFAULT NULL COMMENT 'user id',
  722. `ip` varchar(45) DEFAULT NULL COMMENT 'ip',
  723. `last_login_time` datetime DEFAULT NULL COMMENT 'last login time',
  724. PRIMARY KEY (`id`)
  725. ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
  726. -- ----------------------------
  727. -- Records of t_ds_session
  728. -- ----------------------------
  729. -- ----------------------------
  730. -- Table structure for t_ds_task_instance
  731. -- ----------------------------
  732. DROP TABLE IF EXISTS `t_ds_task_instance`;
  733. CREATE TABLE `t_ds_task_instance` (
  734. `id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'key',
  735. `name` varchar(255) DEFAULT NULL COMMENT 'task name',
  736. `task_type` varchar(50) NOT NULL COMMENT 'task type',
  737. `task_code` bigint(20) NOT NULL COMMENT 'task definition code',
  738. `task_definition_version` int(11) DEFAULT NULL COMMENT 'task definition version',
  739. `process_instance_id` int(11) DEFAULT NULL COMMENT 'process instance id',
  740. `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',
  741. `submit_time` datetime DEFAULT NULL COMMENT 'task submit time',
  742. `start_time` datetime DEFAULT NULL COMMENT 'task start time',
  743. `end_time` datetime DEFAULT NULL COMMENT 'task end time',
  744. `host` varchar(135) DEFAULT NULL COMMENT 'host of task running on',
  745. `execute_path` varchar(200) DEFAULT NULL COMMENT 'task execute path in the host',
  746. `log_path` varchar(200) DEFAULT NULL COMMENT 'task log path',
  747. `alert_flag` tinyint(4) DEFAULT NULL COMMENT 'whether alert',
  748. `retry_times` int(4) DEFAULT '0' COMMENT 'task retry times',
  749. `pid` int(4) DEFAULT NULL COMMENT 'pid of task',
  750. `app_link` text COMMENT 'yarn app id',
  751. `task_params` text COMMENT 'job custom parameters',
  752. `flag` tinyint(4) DEFAULT '1' COMMENT '0 not available, 1 available',
  753. `retry_interval` int(4) DEFAULT NULL COMMENT 'retry interval when task failed ',
  754. `max_retry_times` int(2) DEFAULT NULL COMMENT 'max retry times',
  755. `task_instance_priority` int(11) DEFAULT NULL COMMENT 'task instance priority:0 Highest,1 High,2 Medium,3 Low,4 Lowest',
  756. `worker_group` varchar(64) DEFAULT NULL COMMENT 'worker group id',
  757. `environment_code` bigint(20) NOT NULL COMMENT 'environment code',
  758. `environment_config` text DEFAULT '' COMMENT 'this config contains many environment variables config',
  759. `executor_id` int(11) DEFAULT NULL,
  760. `first_submit_time` datetime DEFAULT NULL COMMENT 'task first submit time',
  761. `delay_time` int(4) DEFAULT '0' COMMENT 'task delay execution time',
  762. `var_pool` longtext COMMENT 'var_pool',
  763. PRIMARY KEY (`id`),
  764. KEY `process_instance_id` (`process_instance_id`) USING BTREE,
  765. CONSTRAINT `foreign_key_instance_id` FOREIGN KEY (`process_instance_id`) REFERENCES `t_ds_process_instance` (`id`) ON DELETE CASCADE
  766. ) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;
  767. -- ----------------------------
  768. -- Records of t_ds_task_instance
  769. -- ----------------------------
  770. -- ----------------------------
  771. -- Table structure for t_ds_tenant
  772. -- ----------------------------
  773. DROP TABLE IF EXISTS `t_ds_tenant`;
  774. CREATE TABLE `t_ds_tenant` (
  775. `id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'key',
  776. `tenant_code` varchar(64) DEFAULT NULL COMMENT 'tenant code',
  777. `description` varchar(255) DEFAULT NULL,
  778. `queue_id` int(11) DEFAULT NULL COMMENT 'queue id',
  779. `create_time` datetime DEFAULT NULL COMMENT 'create time',
  780. `update_time` datetime DEFAULT NULL COMMENT 'update time',
  781. PRIMARY KEY (`id`)
  782. ) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;
  783. -- ----------------------------
  784. -- Records of t_ds_tenant
  785. -- ----------------------------
  786. -- ----------------------------
  787. -- Table structure for t_ds_udfs
  788. -- ----------------------------
  789. DROP TABLE IF EXISTS `t_ds_udfs`;
  790. CREATE TABLE `t_ds_udfs` (
  791. `id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'key',
  792. `user_id` int(11) NOT NULL COMMENT 'user id',
  793. `func_name` varchar(100) NOT NULL COMMENT 'UDF function name',
  794. `class_name` varchar(255) NOT NULL COMMENT 'class of udf',
  795. `type` tinyint(4) NOT NULL COMMENT 'Udf function type',
  796. `arg_types` varchar(255) DEFAULT NULL COMMENT 'arguments types',
  797. `database` varchar(255) DEFAULT NULL COMMENT 'data base',
  798. `description` varchar(255) DEFAULT NULL,
  799. `resource_id` int(11) NOT NULL COMMENT 'resource id',
  800. `resource_name` varchar(255) NOT NULL COMMENT 'resource name',
  801. `create_time` datetime NOT NULL COMMENT 'create time',
  802. `update_time` datetime NOT NULL COMMENT 'update time',
  803. PRIMARY KEY (`id`)
  804. ) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;
  805. -- ----------------------------
  806. -- Records of t_ds_udfs
  807. -- ----------------------------
  808. -- ----------------------------
  809. -- Table structure for t_ds_user
  810. -- ----------------------------
  811. DROP TABLE IF EXISTS `t_ds_user`;
  812. CREATE TABLE `t_ds_user` (
  813. `id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'user id',
  814. `user_name` varchar(64) DEFAULT NULL COMMENT 'user name',
  815. `user_password` varchar(64) DEFAULT NULL COMMENT 'user password',
  816. `user_type` tinyint(4) DEFAULT NULL COMMENT 'user type, 0:administrator,1:ordinary user',
  817. `email` varchar(64) DEFAULT NULL COMMENT 'email',
  818. `phone` varchar(11) DEFAULT NULL COMMENT 'phone',
  819. `tenant_id` int(11) DEFAULT NULL COMMENT 'tenant id',
  820. `create_time` datetime DEFAULT NULL COMMENT 'create time',
  821. `update_time` datetime DEFAULT NULL COMMENT 'update time',
  822. `queue` varchar(64) DEFAULT NULL COMMENT 'queue',
  823. `state` int(1) DEFAULT 1 COMMENT 'state 0:disable 1:enable',
  824. PRIMARY KEY (`id`),
  825. UNIQUE KEY `user_name_unique` (`user_name`)
  826. ) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;
  827. -- ----------------------------
  828. -- Records of t_ds_user
  829. -- ----------------------------
  830. -- ----------------------------
  831. -- Table structure for t_ds_worker_group
  832. -- ----------------------------
  833. DROP TABLE IF EXISTS `t_ds_worker_group`;
  834. CREATE TABLE `t_ds_worker_group` (
  835. `id` bigint(11) NOT NULL AUTO_INCREMENT COMMENT 'id',
  836. `name` varchar(255) NOT NULL COMMENT 'worker group name',
  837. `addr_list` text NULL DEFAULT NULL COMMENT 'worker addr list. split by [,]',
  838. `create_time` datetime NULL DEFAULT NULL COMMENT 'create time',
  839. `update_time` datetime NULL DEFAULT NULL COMMENT 'update time',
  840. PRIMARY KEY (`id`),
  841. UNIQUE KEY `name_unique` (`name`)
  842. ) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;
  843. -- ----------------------------
  844. -- Records of t_ds_worker_group
  845. -- ----------------------------
  846. -- ----------------------------
  847. -- Table structure for t_ds_version
  848. -- ----------------------------
  849. DROP TABLE IF EXISTS `t_ds_version`;
  850. CREATE TABLE `t_ds_version` (
  851. `id` int(11) NOT NULL AUTO_INCREMENT,
  852. `version` varchar(200) NOT NULL,
  853. PRIMARY KEY (`id`),
  854. UNIQUE KEY `version_UNIQUE` (`version`)
  855. ) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8 COMMENT='version';
  856. -- ----------------------------
  857. -- Records of t_ds_version
  858. -- ----------------------------
  859. INSERT INTO `t_ds_version` VALUES ('1', '1.4.0');
  860. -- ----------------------------
  861. -- Records of t_ds_alertgroup
  862. -- ----------------------------
  863. INSERT INTO `t_ds_alertgroup`(alert_instance_ids, create_user_id, group_name, description, create_time, update_time)
  864. VALUES ("1,2", 1, 'default admin warning group', 'default admin warning group', '2018-11-29 10:20:39', '2018-11-29 10:20:39');
  865. -- ----------------------------
  866. -- Records of t_ds_user
  867. -- ----------------------------
  868. INSERT INTO `t_ds_user`
  869. VALUES ('1', 'admin', '7ad2410b2f4c074479a8937a28a22b8f', '0', 'xxx@qq.com', '', '0', '2018-03-27 15:48:50', '2018-10-24 17:40:22', null, 1);
  870. -- ----------------------------
  871. -- Table structure for t_ds_plugin_define
  872. -- ----------------------------
  873. SET sql_mode=(SELECT REPLACE(@@sql_mode,'ONLY_FULL_GROUP_BY',''));
  874. DROP TABLE IF EXISTS `t_ds_plugin_define`;
  875. CREATE TABLE `t_ds_plugin_define` (
  876. `id` int NOT NULL AUTO_INCREMENT,
  877. `plugin_name` varchar(100) NOT NULL COMMENT 'the name of plugin eg: email',
  878. `plugin_type` varchar(100) NOT NULL COMMENT 'plugin type . alert=alert plugin, job=job plugin',
  879. `plugin_params` text COMMENT 'plugin params',
  880. `create_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  881. `update_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  882. PRIMARY KEY (`id`),
  883. UNIQUE KEY `t_ds_plugin_define_UN` (`plugin_name`,`plugin_type`)
  884. ) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8;
  885. -- ----------------------------
  886. -- Table structure for t_ds_alert_plugin_instance
  887. -- ----------------------------
  888. DROP TABLE IF EXISTS `t_ds_alert_plugin_instance`;
  889. CREATE TABLE `t_ds_alert_plugin_instance` (
  890. `id` int NOT NULL AUTO_INCREMENT,
  891. `plugin_define_id` int NOT NULL,
  892. `plugin_instance_params` text COMMENT 'plugin instance params. Also contain the params value which user input in web ui.',
  893. `create_time` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  894. `update_time` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  895. `instance_name` varchar(200) DEFAULT NULL COMMENT 'alert instance name',
  896. PRIMARY KEY (`id`)
  897. ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
  898. -- ----------------------------
  899. -- Table structure for t_ds_environment
  900. -- ----------------------------
  901. DROP TABLE IF EXISTS `t_ds_environment`;
  902. CREATE TABLE `t_ds_environment` (
  903. `id` bigint(11) NOT NULL AUTO_INCREMENT COMMENT 'id',
  904. `code` bigint(20) DEFAULT NULL COMMENT 'encoding',
  905. `name` varchar(100) NOT NULL COMMENT 'environment name',
  906. `config` text NULL DEFAULT NULL COMMENT 'this config contains many environment variables config',
  907. `description` text NULL DEFAULT NULL COMMENT 'the details',
  908. `operator` int(11) DEFAULT NULL COMMENT 'operator user id',
  909. `create_time` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  910. `update_time` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  911. PRIMARY KEY (`id`),
  912. UNIQUE KEY `environment_name_unique` (`name`),
  913. UNIQUE KEY `environment_code_unique` (`code`),
  914. ) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;
  915. -- ----------------------------
  916. -- Table structure for t_ds_environment_worker_group_relation
  917. -- ----------------------------
  918. DROP TABLE IF EXISTS `t_ds_environment_worker_group_relation`;
  919. CREATE TABLE `t_ds_environment_worker_group_relation` (
  920. `id` bigint(11) NOT NULL AUTO_INCREMENT COMMENT 'id',
  921. `environment_code` bigint(20) NOT NULL COMMENT 'environment code',
  922. `worker_group` varchar(255) NOT NULL COMMENT 'worker group id',
  923. `operator` int(11) DEFAULT NULL COMMENT 'operator user id',
  924. `create_time` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  925. `update_time` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  926. PRIMARY KEY (`id`),
  927. UNIQUE KEY `environment_worker_group_unique` (`environment_code`,`worker_group`)
  928. ) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;