dolphinscheduler_mysql.sql 47 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008
  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) DEFAULT '-1' 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) DEFAULT '-1' 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) DEFAULT '-1' 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) DEFAULT '-1' 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. `environment_code` bigint(20) DEFAULT '-1' COMMENT 'environment code',
  543. `timeout` int(11) DEFAULT '0' COMMENT 'time out',
  544. `tenant_id` int(11) NOT NULL DEFAULT '-1' COMMENT 'tenant id',
  545. `var_pool` longtext COMMENT 'var_pool',
  546. PRIMARY KEY (`id`),
  547. KEY `process_instance_index` (`process_definition_code`,`id`) USING BTREE,
  548. KEY `start_time_index` (`start_time`) USING BTREE
  549. ) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;
  550. -- ----------------------------
  551. -- Records of t_ds_process_instance
  552. -- ----------------------------
  553. -- ----------------------------
  554. -- Table structure for t_ds_project
  555. -- ----------------------------
  556. DROP TABLE IF EXISTS `t_ds_project`;
  557. CREATE TABLE `t_ds_project` (
  558. `id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'key',
  559. `name` varchar(100) DEFAULT NULL COMMENT 'project name',
  560. `code` bigint(20) NOT NULL COMMENT 'encoding',
  561. `description` varchar(200) DEFAULT NULL,
  562. `user_id` int(11) DEFAULT NULL COMMENT 'creator id',
  563. `flag` tinyint(4) DEFAULT '1' COMMENT '0 not available, 1 available',
  564. `create_time` datetime NOT NULL COMMENT 'create time',
  565. `update_time` datetime DEFAULT NULL COMMENT 'update time',
  566. PRIMARY KEY (`id`),
  567. KEY `user_id_index` (`user_id`) USING BTREE
  568. ) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;
  569. -- ----------------------------
  570. -- Records of t_ds_project
  571. -- ----------------------------
  572. -- ----------------------------
  573. -- Table structure for t_ds_queue
  574. -- ----------------------------
  575. DROP TABLE IF EXISTS `t_ds_queue`;
  576. CREATE TABLE `t_ds_queue` (
  577. `id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'key',
  578. `queue_name` varchar(64) DEFAULT NULL COMMENT 'queue name',
  579. `queue` varchar(64) DEFAULT NULL COMMENT 'yarn queue name',
  580. `create_time` datetime DEFAULT NULL COMMENT 'create time',
  581. `update_time` datetime DEFAULT NULL COMMENT 'update time',
  582. PRIMARY KEY (`id`)
  583. ) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;
  584. -- ----------------------------
  585. -- Records of t_ds_queue
  586. -- ----------------------------
  587. INSERT INTO `t_ds_queue` VALUES ('1', 'default', 'default', null, null);
  588. -- ----------------------------
  589. -- Table structure for t_ds_relation_datasource_user
  590. -- ----------------------------
  591. DROP TABLE IF EXISTS `t_ds_relation_datasource_user`;
  592. CREATE TABLE `t_ds_relation_datasource_user` (
  593. `id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'key',
  594. `user_id` int(11) NOT NULL COMMENT 'user id',
  595. `datasource_id` int(11) DEFAULT NULL COMMENT 'data source id',
  596. `perm` int(11) DEFAULT '1' COMMENT 'limits of authority',
  597. `create_time` datetime DEFAULT NULL COMMENT 'create time',
  598. `update_time` datetime DEFAULT NULL COMMENT 'update time',
  599. PRIMARY KEY (`id`)
  600. ) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;
  601. -- ----------------------------
  602. -- Records of t_ds_relation_datasource_user
  603. -- ----------------------------
  604. -- ----------------------------
  605. -- Table structure for t_ds_relation_process_instance
  606. -- ----------------------------
  607. DROP TABLE IF EXISTS `t_ds_relation_process_instance`;
  608. CREATE TABLE `t_ds_relation_process_instance` (
  609. `id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'key',
  610. `parent_process_instance_id` int(11) DEFAULT NULL COMMENT 'parent process instance id',
  611. `parent_task_instance_id` int(11) DEFAULT NULL COMMENT 'parent process instance id',
  612. `process_instance_id` int(11) DEFAULT NULL COMMENT 'child process instance id',
  613. PRIMARY KEY (`id`)
  614. ) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;
  615. -- ----------------------------
  616. -- Records of t_ds_relation_process_instance
  617. -- ----------------------------
  618. -- ----------------------------
  619. -- Table structure for t_ds_relation_project_user
  620. -- ----------------------------
  621. DROP TABLE IF EXISTS `t_ds_relation_project_user`;
  622. CREATE TABLE `t_ds_relation_project_user` (
  623. `id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'key',
  624. `user_id` int(11) NOT NULL COMMENT 'user id',
  625. `project_id` int(11) DEFAULT NULL COMMENT 'project id',
  626. `perm` int(11) DEFAULT '1' COMMENT 'limits of authority',
  627. `create_time` datetime DEFAULT NULL COMMENT 'create time',
  628. `update_time` datetime DEFAULT NULL COMMENT 'update time',
  629. PRIMARY KEY (`id`),
  630. KEY `user_id_index` (`user_id`) USING BTREE
  631. ) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;
  632. -- ----------------------------
  633. -- Records of t_ds_relation_project_user
  634. -- ----------------------------
  635. -- ----------------------------
  636. -- Table structure for t_ds_relation_resources_user
  637. -- ----------------------------
  638. DROP TABLE IF EXISTS `t_ds_relation_resources_user`;
  639. CREATE TABLE `t_ds_relation_resources_user` (
  640. `id` int(11) NOT NULL AUTO_INCREMENT,
  641. `user_id` int(11) NOT NULL COMMENT 'user id',
  642. `resources_id` int(11) DEFAULT NULL COMMENT 'resource id',
  643. `perm` int(11) DEFAULT '1' COMMENT 'limits of authority',
  644. `create_time` datetime DEFAULT NULL COMMENT 'create time',
  645. `update_time` datetime DEFAULT NULL COMMENT 'update time',
  646. PRIMARY KEY (`id`)
  647. ) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;
  648. -- ----------------------------
  649. -- Records of t_ds_relation_resources_user
  650. -- ----------------------------
  651. -- ----------------------------
  652. -- Table structure for t_ds_relation_udfs_user
  653. -- ----------------------------
  654. DROP TABLE IF EXISTS `t_ds_relation_udfs_user`;
  655. CREATE TABLE `t_ds_relation_udfs_user` (
  656. `id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'key',
  657. `user_id` int(11) NOT NULL COMMENT 'userid',
  658. `udf_id` int(11) DEFAULT NULL COMMENT 'udf id',
  659. `perm` int(11) DEFAULT '1' COMMENT 'limits of authority',
  660. `create_time` datetime DEFAULT NULL COMMENT 'create time',
  661. `update_time` datetime DEFAULT NULL COMMENT 'update time',
  662. PRIMARY KEY (`id`)
  663. ) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;
  664. -- ----------------------------
  665. -- Table structure for t_ds_resources
  666. -- ----------------------------
  667. DROP TABLE IF EXISTS `t_ds_resources`;
  668. CREATE TABLE `t_ds_resources` (
  669. `id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'key',
  670. `alias` varchar(64) DEFAULT NULL COMMENT 'alias',
  671. `file_name` varchar(64) DEFAULT NULL COMMENT 'file name',
  672. `description` varchar(255) DEFAULT NULL,
  673. `user_id` int(11) DEFAULT NULL COMMENT 'user id',
  674. `type` tinyint(4) DEFAULT NULL COMMENT 'resource type,0:FILE,1:UDF',
  675. `size` bigint(20) DEFAULT NULL COMMENT 'resource size',
  676. `create_time` datetime DEFAULT NULL COMMENT 'create time',
  677. `update_time` datetime DEFAULT NULL COMMENT 'update time',
  678. `pid` int(11) DEFAULT NULL,
  679. `full_name` varchar(64) DEFAULT NULL,
  680. `is_directory` tinyint(4) DEFAULT NULL,
  681. PRIMARY KEY (`id`),
  682. UNIQUE KEY `t_ds_resources_un` (`full_name`,`type`)
  683. ) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;
  684. -- ----------------------------
  685. -- Records of t_ds_resources
  686. -- ----------------------------
  687. -- ----------------------------
  688. -- Table structure for t_ds_schedules
  689. -- ----------------------------
  690. DROP TABLE IF EXISTS `t_ds_schedules`;
  691. CREATE TABLE `t_ds_schedules` (
  692. `id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'key',
  693. `process_definition_code` bigint(20) NOT NULL COMMENT 'process definition code',
  694. `start_time` datetime NOT NULL COMMENT 'start time',
  695. `end_time` datetime NOT NULL COMMENT 'end time',
  696. `timezone_id` varchar(40) DEFAULT NULL COMMENT 'timezoneId',
  697. `crontab` varchar(255) NOT NULL COMMENT 'crontab description',
  698. `failure_strategy` tinyint(4) NOT NULL COMMENT 'failure strategy. 0:end,1:continue',
  699. `user_id` int(11) NOT NULL COMMENT 'user id',
  700. `release_state` tinyint(4) NOT NULL COMMENT 'release state. 0:offline,1:online ',
  701. `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',
  702. `warning_group_id` int(11) DEFAULT NULL COMMENT 'alert group id',
  703. `process_instance_priority` int(11) DEFAULT NULL COMMENT 'process instance priority:0 Highest,1 High,2 Medium,3 Low,4 Lowest',
  704. `worker_group` varchar(64) DEFAULT '' COMMENT 'worker group id',
  705. `environment_code` bigint(20) DEFAULT '-1' COMMENT 'environment code',
  706. `create_time` datetime NOT NULL COMMENT 'create time',
  707. `update_time` datetime NOT NULL COMMENT 'update time',
  708. PRIMARY KEY (`id`)
  709. ) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;
  710. -- ----------------------------
  711. -- Records of t_ds_schedules
  712. -- ----------------------------
  713. -- ----------------------------
  714. -- Table structure for t_ds_session
  715. -- ----------------------------
  716. DROP TABLE IF EXISTS `t_ds_session`;
  717. CREATE TABLE `t_ds_session` (
  718. `id` varchar(64) NOT NULL COMMENT 'key',
  719. `user_id` int(11) DEFAULT NULL COMMENT 'user id',
  720. `ip` varchar(45) DEFAULT NULL COMMENT 'ip',
  721. `last_login_time` datetime DEFAULT NULL COMMENT 'last login time',
  722. PRIMARY KEY (`id`)
  723. ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
  724. -- ----------------------------
  725. -- Records of t_ds_session
  726. -- ----------------------------
  727. -- ----------------------------
  728. -- Table structure for t_ds_task_instance
  729. -- ----------------------------
  730. DROP TABLE IF EXISTS `t_ds_task_instance`;
  731. CREATE TABLE `t_ds_task_instance` (
  732. `id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'key',
  733. `name` varchar(255) DEFAULT NULL COMMENT 'task name',
  734. `task_type` varchar(50) NOT NULL COMMENT 'task type',
  735. `task_code` bigint(20) NOT NULL COMMENT 'task definition code',
  736. `task_definition_version` int(11) DEFAULT NULL COMMENT 'task definition version',
  737. `process_instance_id` int(11) DEFAULT NULL COMMENT 'process instance id',
  738. `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',
  739. `submit_time` datetime DEFAULT NULL COMMENT 'task submit time',
  740. `start_time` datetime DEFAULT NULL COMMENT 'task start time',
  741. `end_time` datetime DEFAULT NULL COMMENT 'task end time',
  742. `host` varchar(135) DEFAULT NULL COMMENT 'host of task running on',
  743. `execute_path` varchar(200) DEFAULT NULL COMMENT 'task execute path in the host',
  744. `log_path` varchar(200) DEFAULT NULL COMMENT 'task log path',
  745. `alert_flag` tinyint(4) DEFAULT NULL COMMENT 'whether alert',
  746. `retry_times` int(4) DEFAULT '0' COMMENT 'task retry times',
  747. `pid` int(4) DEFAULT NULL COMMENT 'pid of task',
  748. `app_link` text COMMENT 'yarn app id',
  749. `task_params` text COMMENT 'job custom parameters',
  750. `flag` tinyint(4) DEFAULT '1' COMMENT '0 not available, 1 available',
  751. `retry_interval` int(4) DEFAULT NULL COMMENT 'retry interval when task failed ',
  752. `max_retry_times` int(2) DEFAULT NULL COMMENT 'max retry times',
  753. `task_instance_priority` int(11) DEFAULT NULL COMMENT 'task instance priority:0 Highest,1 High,2 Medium,3 Low,4 Lowest',
  754. `worker_group` varchar(64) DEFAULT NULL COMMENT 'worker group id',
  755. `environment_code` bigint(20) DEFAULT '-1' COMMENT 'environment code',
  756. `environment_config` text COMMENT 'this config contains many environment variables config',
  757. `executor_id` int(11) DEFAULT NULL,
  758. `first_submit_time` datetime DEFAULT NULL COMMENT 'task first submit time',
  759. `delay_time` int(4) DEFAULT '0' COMMENT 'task delay execution time',
  760. `var_pool` longtext COMMENT 'var_pool',
  761. PRIMARY KEY (`id`),
  762. KEY `process_instance_id` (`process_instance_id`) USING BTREE,
  763. CONSTRAINT `foreign_key_instance_id` FOREIGN KEY (`process_instance_id`) REFERENCES `t_ds_process_instance` (`id`) ON DELETE CASCADE
  764. ) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;
  765. -- ----------------------------
  766. -- Records of t_ds_task_instance
  767. -- ----------------------------
  768. -- ----------------------------
  769. -- Table structure for t_ds_tenant
  770. -- ----------------------------
  771. DROP TABLE IF EXISTS `t_ds_tenant`;
  772. CREATE TABLE `t_ds_tenant` (
  773. `id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'key',
  774. `tenant_code` varchar(64) DEFAULT NULL COMMENT 'tenant code',
  775. `description` varchar(255) DEFAULT NULL,
  776. `queue_id` int(11) DEFAULT NULL COMMENT 'queue id',
  777. `create_time` datetime DEFAULT NULL COMMENT 'create time',
  778. `update_time` datetime DEFAULT NULL COMMENT 'update time',
  779. PRIMARY KEY (`id`)
  780. ) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;
  781. -- ----------------------------
  782. -- Records of t_ds_tenant
  783. -- ----------------------------
  784. -- ----------------------------
  785. -- Table structure for t_ds_udfs
  786. -- ----------------------------
  787. DROP TABLE IF EXISTS `t_ds_udfs`;
  788. CREATE TABLE `t_ds_udfs` (
  789. `id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'key',
  790. `user_id` int(11) NOT NULL COMMENT 'user id',
  791. `func_name` varchar(100) NOT NULL COMMENT 'UDF function name',
  792. `class_name` varchar(255) NOT NULL COMMENT 'class of udf',
  793. `type` tinyint(4) NOT NULL COMMENT 'Udf function type',
  794. `arg_types` varchar(255) DEFAULT NULL COMMENT 'arguments types',
  795. `database` varchar(255) DEFAULT NULL COMMENT 'data base',
  796. `description` varchar(255) DEFAULT NULL,
  797. `resource_id` int(11) NOT NULL COMMENT 'resource id',
  798. `resource_name` varchar(255) NOT NULL COMMENT 'resource name',
  799. `create_time` datetime NOT NULL COMMENT 'create time',
  800. `update_time` datetime NOT NULL COMMENT 'update time',
  801. PRIMARY KEY (`id`)
  802. ) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;
  803. -- ----------------------------
  804. -- Records of t_ds_udfs
  805. -- ----------------------------
  806. -- ----------------------------
  807. -- Table structure for t_ds_user
  808. -- ----------------------------
  809. DROP TABLE IF EXISTS `t_ds_user`;
  810. CREATE TABLE `t_ds_user` (
  811. `id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'user id',
  812. `user_name` varchar(64) DEFAULT NULL COMMENT 'user name',
  813. `user_password` varchar(64) DEFAULT NULL COMMENT 'user password',
  814. `user_type` tinyint(4) DEFAULT NULL COMMENT 'user type, 0:administrator,1:ordinary user',
  815. `email` varchar(64) DEFAULT NULL COMMENT 'email',
  816. `phone` varchar(11) DEFAULT NULL COMMENT 'phone',
  817. `tenant_id` int(11) DEFAULT NULL COMMENT 'tenant id',
  818. `create_time` datetime DEFAULT NULL COMMENT 'create time',
  819. `update_time` datetime DEFAULT NULL COMMENT 'update time',
  820. `queue` varchar(64) DEFAULT NULL COMMENT 'queue',
  821. `state` int(1) DEFAULT 1 COMMENT 'state 0:disable 1:enable',
  822. PRIMARY KEY (`id`),
  823. UNIQUE KEY `user_name_unique` (`user_name`)
  824. ) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;
  825. -- ----------------------------
  826. -- Records of t_ds_user
  827. -- ----------------------------
  828. -- ----------------------------
  829. -- Table structure for t_ds_worker_group
  830. -- ----------------------------
  831. DROP TABLE IF EXISTS `t_ds_worker_group`;
  832. CREATE TABLE `t_ds_worker_group` (
  833. `id` bigint(11) NOT NULL AUTO_INCREMENT COMMENT 'id',
  834. `name` varchar(255) NOT NULL COMMENT 'worker group name',
  835. `addr_list` text NULL DEFAULT NULL COMMENT 'worker addr list. split by [,]',
  836. `create_time` datetime NULL DEFAULT NULL COMMENT 'create time',
  837. `update_time` datetime NULL DEFAULT NULL COMMENT 'update time',
  838. PRIMARY KEY (`id`),
  839. UNIQUE KEY `name_unique` (`name`)
  840. ) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;
  841. -- ----------------------------
  842. -- Records of t_ds_worker_group
  843. -- ----------------------------
  844. -- ----------------------------
  845. -- Table structure for t_ds_version
  846. -- ----------------------------
  847. DROP TABLE IF EXISTS `t_ds_version`;
  848. CREATE TABLE `t_ds_version` (
  849. `id` int(11) NOT NULL AUTO_INCREMENT,
  850. `version` varchar(200) NOT NULL,
  851. PRIMARY KEY (`id`),
  852. UNIQUE KEY `version_UNIQUE` (`version`)
  853. ) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8 COMMENT='version';
  854. -- ----------------------------
  855. -- Records of t_ds_version
  856. -- ----------------------------
  857. INSERT INTO `t_ds_version` VALUES ('1', '1.4.0');
  858. -- ----------------------------
  859. -- Records of t_ds_alertgroup
  860. -- ----------------------------
  861. INSERT INTO `t_ds_alertgroup`(alert_instance_ids, create_user_id, group_name, description, create_time, update_time)
  862. VALUES ("1,2", 1, 'default admin warning group', 'default admin warning group', '2018-11-29 10:20:39', '2018-11-29 10:20:39');
  863. -- ----------------------------
  864. -- Records of t_ds_user
  865. -- ----------------------------
  866. INSERT INTO `t_ds_user`
  867. VALUES ('1', 'admin', '7ad2410b2f4c074479a8937a28a22b8f', '0', 'xxx@qq.com', '', '0', '2018-03-27 15:48:50', '2018-10-24 17:40:22', null, 1);
  868. -- ----------------------------
  869. -- Table structure for t_ds_plugin_define
  870. -- ----------------------------
  871. SET sql_mode=(SELECT REPLACE(@@sql_mode,'ONLY_FULL_GROUP_BY',''));
  872. DROP TABLE IF EXISTS `t_ds_plugin_define`;
  873. CREATE TABLE `t_ds_plugin_define` (
  874. `id` int NOT NULL AUTO_INCREMENT,
  875. `plugin_name` varchar(100) NOT NULL COMMENT 'the name of plugin eg: email',
  876. `plugin_type` varchar(100) NOT NULL COMMENT 'plugin type . alert=alert plugin, job=job plugin',
  877. `plugin_params` text COMMENT 'plugin params',
  878. `create_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  879. `update_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  880. PRIMARY KEY (`id`),
  881. UNIQUE KEY `t_ds_plugin_define_UN` (`plugin_name`,`plugin_type`)
  882. ) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8;
  883. -- ----------------------------
  884. -- Table structure for t_ds_alert_plugin_instance
  885. -- ----------------------------
  886. DROP TABLE IF EXISTS `t_ds_alert_plugin_instance`;
  887. CREATE TABLE `t_ds_alert_plugin_instance` (
  888. `id` int NOT NULL AUTO_INCREMENT,
  889. `plugin_define_id` int NOT NULL,
  890. `plugin_instance_params` text COMMENT 'plugin instance params. Also contain the params value which user input in web ui.',
  891. `create_time` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  892. `update_time` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  893. `instance_name` varchar(200) DEFAULT NULL COMMENT 'alert instance name',
  894. PRIMARY KEY (`id`)
  895. ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
  896. -- ----------------------------
  897. -- Table structure for t_ds_environment
  898. -- ----------------------------
  899. DROP TABLE IF EXISTS `t_ds_environment`;
  900. CREATE TABLE `t_ds_environment` (
  901. `id` bigint(11) NOT NULL AUTO_INCREMENT COMMENT 'id',
  902. `code` bigint(20) DEFAULT NULL COMMENT 'encoding',
  903. `name` varchar(100) NOT NULL COMMENT 'environment name',
  904. `config` text NULL DEFAULT NULL COMMENT 'this config contains many environment variables config',
  905. `description` text NULL DEFAULT NULL COMMENT 'the details',
  906. `operator` int(11) DEFAULT NULL COMMENT 'operator user id',
  907. `create_time` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  908. `update_time` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  909. PRIMARY KEY (`id`),
  910. UNIQUE KEY `environment_name_unique` (`name`),
  911. UNIQUE KEY `environment_code_unique` (`code`)
  912. ) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;
  913. -- ----------------------------
  914. -- Table structure for t_ds_environment_worker_group_relation
  915. -- ----------------------------
  916. DROP TABLE IF EXISTS `t_ds_environment_worker_group_relation`;
  917. CREATE TABLE `t_ds_environment_worker_group_relation` (
  918. `id` bigint(11) NOT NULL AUTO_INCREMENT COMMENT 'id',
  919. `environment_code` bigint(20) NOT NULL COMMENT 'environment code',
  920. `worker_group` varchar(255) NOT NULL COMMENT 'worker group id',
  921. `operator` int(11) DEFAULT NULL COMMENT 'operator user id',
  922. `create_time` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  923. `update_time` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  924. PRIMARY KEY (`id`),
  925. UNIQUE KEY `environment_worker_group_unique` (`environment_code`,`worker_group`)
  926. ) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;