dolphinscheduler_mysql.sql 45 KB

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