dolphinscheduler_mysql.sql 47 KB

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