dolphinscheduler_ddl.sql 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408
  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 sql_mode=(SELECT REPLACE(@@sql_mode,'ONLY_FULL_GROUP_BY',''));
  18. -- uc_dolphin_T_t_ds_user_A_state
  19. drop PROCEDURE if EXISTS uc_dolphin_T_t_ds_user_A_state;
  20. delimiter d//
  21. CREATE PROCEDURE uc_dolphin_T_t_ds_user_A_state()
  22. BEGIN
  23. IF NOT EXISTS (SELECT 1 FROM information_schema.COLUMNS
  24. WHERE TABLE_NAME='t_ds_user'
  25. AND TABLE_SCHEMA=(SELECT DATABASE())
  26. AND COLUMN_NAME ='state')
  27. THEN
  28. ALTER TABLE t_ds_user ADD `state` tinyint(4) DEFAULT '1' COMMENT 'state 0:disable 1:enable';
  29. END IF;
  30. END;
  31. d//
  32. delimiter ;
  33. CALL uc_dolphin_T_t_ds_user_A_state;
  34. DROP PROCEDURE uc_dolphin_T_t_ds_user_A_state;
  35. -- uc_dolphin_T_t_ds_tenant_A_tenant_name
  36. drop PROCEDURE if EXISTS uc_dolphin_T_t_ds_tenant_A_tenant_name;
  37. delimiter d//
  38. CREATE PROCEDURE uc_dolphin_T_t_ds_tenant_A_tenant_name()
  39. BEGIN
  40. IF EXISTS (SELECT 1 FROM information_schema.COLUMNS
  41. WHERE TABLE_NAME='t_ds_tenant'
  42. AND TABLE_SCHEMA=(SELECT DATABASE())
  43. AND COLUMN_NAME ='tenant_name')
  44. THEN
  45. ALTER TABLE t_ds_tenant DROP `tenant_name`;
  46. END IF;
  47. END;
  48. d//
  49. delimiter ;
  50. CALL uc_dolphin_T_t_ds_tenant_A_tenant_name;
  51. DROP PROCEDURE uc_dolphin_T_t_ds_tenant_A_tenant_name;
  52. -- uc_dolphin_T_t_ds_alertgroup_A_alert_instance_ids
  53. drop PROCEDURE if EXISTS uc_dolphin_T_t_ds_alertgroup_A_alert_instance_ids;
  54. delimiter d//
  55. CREATE PROCEDURE uc_dolphin_T_t_ds_alertgroup_A_alert_instance_ids()
  56. BEGIN
  57. IF NOT EXISTS (SELECT 1 FROM information_schema.COLUMNS
  58. WHERE TABLE_NAME='t_ds_alertgroup'
  59. AND TABLE_SCHEMA=(SELECT DATABASE())
  60. AND COLUMN_NAME ='alert_instance_ids')
  61. THEN
  62. ALTER TABLE t_ds_alertgroup ADD COLUMN `alert_instance_ids` varchar (255) DEFAULT NULL COMMENT 'alert instance ids' AFTER `id`;
  63. END IF;
  64. END;
  65. d//
  66. delimiter ;
  67. CALL uc_dolphin_T_t_ds_alertgroup_A_alert_instance_ids();
  68. DROP PROCEDURE uc_dolphin_T_t_ds_alertgroup_A_alert_instance_ids;
  69. -- uc_dolphin_T_t_ds_alertgroup_A_create_user_id
  70. drop PROCEDURE if EXISTS uc_dolphin_T_t_ds_alertgroup_A_create_user_id;
  71. delimiter d//
  72. CREATE PROCEDURE uc_dolphin_T_t_ds_alertgroup_A_create_user_id()
  73. BEGIN
  74. IF NOT EXISTS (SELECT 1 FROM information_schema.COLUMNS
  75. WHERE TABLE_NAME='t_ds_alertgroup'
  76. AND TABLE_SCHEMA=(SELECT DATABASE())
  77. AND COLUMN_NAME ='create_user_id')
  78. THEN
  79. ALTER TABLE t_ds_alertgroup ADD COLUMN `create_user_id` int(11) DEFAULT NULL COMMENT 'create user id' AFTER `alert_instance_ids`;
  80. END IF;
  81. END;
  82. d//
  83. delimiter ;
  84. CALL uc_dolphin_T_t_ds_alertgroup_A_create_user_id();
  85. DROP PROCEDURE uc_dolphin_T_t_ds_alertgroup_A_create_user_id;
  86. -- uc_dolphin_T_t_ds_alertgroup_A_add_UN_groupName
  87. drop PROCEDURE if EXISTS uc_dolphin_T_t_ds_alertgroup_A_add_UN_groupName;
  88. delimiter d//
  89. CREATE PROCEDURE uc_dolphin_T_t_ds_alertgroup_A_add_UN_groupName()
  90. BEGIN
  91. IF NOT EXISTS (SELECT 1 FROM information_schema.STATISTICS
  92. WHERE TABLE_NAME='t_ds_alertgroup'
  93. AND TABLE_SCHEMA=(SELECT DATABASE())
  94. AND INDEX_NAME ='t_ds_alertgroup_name_un')
  95. THEN
  96. ALTER TABLE t_ds_alertgroup ADD UNIQUE KEY `t_ds_alertgroup_name_un` (`group_name`);
  97. END IF;
  98. END;
  99. d//
  100. delimiter ;
  101. CALL uc_dolphin_T_t_ds_alertgroup_A_add_UN_groupName();
  102. DROP PROCEDURE uc_dolphin_T_t_ds_alertgroup_A_add_UN_groupName;
  103. -- uc_dolphin_T_t_ds_datasource_A_add_UN_datasourceName
  104. drop PROCEDURE if EXISTS uc_dolphin_T_t_ds_datasource_A_add_UN_datasourceName;
  105. delimiter d//
  106. CREATE PROCEDURE uc_dolphin_T_t_ds_datasource_A_add_UN_datasourceName()
  107. BEGIN
  108. IF NOT EXISTS (SELECT 1 FROM information_schema.STATISTICS
  109. WHERE TABLE_NAME='t_ds_datasource'
  110. AND TABLE_SCHEMA=(SELECT DATABASE())
  111. AND INDEX_NAME ='t_ds_datasource_name_un')
  112. THEN
  113. ALTER TABLE t_ds_datasource ADD UNIQUE KEY `t_ds_datasource_name_un` (`name`, `type`);
  114. END IF;
  115. END;
  116. d//
  117. delimiter ;
  118. CALL uc_dolphin_T_t_ds_datasource_A_add_UN_datasourceName();
  119. DROP PROCEDURE uc_dolphin_T_t_ds_datasource_A_add_UN_datasourceName;
  120. -- uc_dolphin_T_t_ds_project_A_add_code
  121. drop PROCEDURE if EXISTS uc_dolphin_T_t_ds_project_A_add_code;
  122. delimiter d//
  123. CREATE PROCEDURE uc_dolphin_T_t_ds_project_A_add_code()
  124. BEGIN
  125. IF NOT EXISTS (SELECT 1 FROM information_schema.COLUMNS
  126. WHERE TABLE_NAME='t_ds_project'
  127. AND TABLE_SCHEMA=(SELECT DATABASE())
  128. AND COLUMN_NAME ='code')
  129. THEN
  130. alter table t_ds_project add `code` bigint(20) NOT NULL COMMENT 'encoding' AFTER `name`;
  131. END IF;
  132. END;
  133. d//
  134. delimiter ;
  135. CALL uc_dolphin_T_t_ds_project_A_add_code();
  136. DROP PROCEDURE uc_dolphin_T_t_ds_project_A_add_code;
  137. -- ----------------------------
  138. -- Table structure for t_ds_plugin_define
  139. -- ----------------------------
  140. SET sql_mode=(SELECT REPLACE(@@sql_mode,'ONLY_FULL_GROUP_BY',''));
  141. DROP TABLE IF EXISTS `t_ds_plugin_define`;
  142. CREATE TABLE `t_ds_plugin_define` (
  143. `id` int NOT NULL AUTO_INCREMENT,
  144. `plugin_name` varchar(100) NOT NULL COMMENT 'the name of plugin eg: email',
  145. `plugin_type` varchar(100) NOT NULL COMMENT 'plugin type . alert=alert plugin, job=job plugin',
  146. `plugin_params` text COMMENT 'plugin params',
  147. `create_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  148. `update_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  149. PRIMARY KEY (`id`),
  150. UNIQUE KEY `t_ds_plugin_define_UN` (`plugin_name`,`plugin_type`)
  151. ) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8;
  152. -- ----------------------------
  153. -- Table structure for t_ds_alert_plugin_instance
  154. -- ----------------------------
  155. DROP TABLE IF EXISTS `t_ds_alert_plugin_instance`;
  156. CREATE TABLE `t_ds_alert_plugin_instance` (
  157. `id` int NOT NULL AUTO_INCREMENT,
  158. `plugin_define_id` int NOT NULL,
  159. `plugin_instance_params` text COMMENT 'plugin instance params. Also contain the params value which user input in web ui.',
  160. `create_time` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  161. `update_time` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  162. `instance_name` varchar(200) DEFAULT NULL COMMENT 'alert instance name',
  163. PRIMARY KEY (`id`)
  164. ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
  165. -- ----------------------------
  166. -- Table structure for t_ds_environment
  167. -- ----------------------------
  168. DROP TABLE IF EXISTS `t_ds_environment`;
  169. CREATE TABLE `t_ds_environment` (
  170. `id` bigint(11) NOT NULL AUTO_INCREMENT COMMENT 'id',
  171. `code` bigint(20) DEFAULT NULL COMMENT 'encoding',
  172. `name` varchar(100) NOT NULL COMMENT 'environment name',
  173. `config` text NULL DEFAULT NULL COMMENT 'this config contains many environment variables config',
  174. `description` text NULL DEFAULT NULL COMMENT 'the details',
  175. `operator` int(11) DEFAULT NULL COMMENT 'operator user id',
  176. `create_time` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  177. `update_time` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  178. PRIMARY KEY (`id`),
  179. UNIQUE KEY `environment_name_unique` (`name`),
  180. UNIQUE KEY `environment_code_unique` (`code`)
  181. ) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;
  182. -- ----------------------------
  183. -- Table structure for t_ds_environment_worker_group_relation
  184. -- ----------------------------
  185. DROP TABLE IF EXISTS `t_ds_environment_worker_group_relation`;
  186. CREATE TABLE `t_ds_environment_worker_group_relation` (
  187. `id` bigint(11) NOT NULL AUTO_INCREMENT COMMENT 'id',
  188. `environment_code` bigint(20) NOT NULL COMMENT 'environment code',
  189. `worker_group` varchar(255) NOT NULL COMMENT 'worker group id',
  190. `operator` int(11) DEFAULT NULL COMMENT 'operator user id',
  191. `create_time` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  192. `update_time` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  193. PRIMARY KEY (`id`),
  194. UNIQUE KEY `environment_worker_group_unique` (`environment_code`,`worker_group`)
  195. ) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;
  196. -- ----------------------------
  197. -- Table structure for t_ds_process_definition_log
  198. -- ----------------------------
  199. DROP TABLE IF EXISTS `t_ds_process_definition_log`;
  200. CREATE TABLE `t_ds_process_definition_log` (
  201. `id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'self-increasing id',
  202. `code` bigint(20) NOT NULL COMMENT 'encoding',
  203. `name` varchar(200) DEFAULT NULL COMMENT 'process definition name',
  204. `version` int(11) DEFAULT '0' COMMENT 'process definition version',
  205. `description` text COMMENT 'description',
  206. `project_code` bigint(20) NOT NULL COMMENT 'project code',
  207. `release_state` tinyint(4) DEFAULT NULL COMMENT 'process definition release state:0:offline,1:online',
  208. `user_id` int(11) DEFAULT NULL COMMENT 'process definition creator id',
  209. `global_params` text COMMENT 'global parameters',
  210. `flag` tinyint(4) DEFAULT NULL COMMENT '0 not available, 1 available',
  211. `locations` text COMMENT 'Node location information',
  212. `warning_group_id` int(11) DEFAULT NULL COMMENT 'alert group id',
  213. `timeout` int(11) DEFAULT '0' COMMENT 'time out,unit: minute',
  214. `tenant_id` int(11) NOT NULL DEFAULT '-1' COMMENT 'tenant id',
  215. `operator` int(11) DEFAULT NULL COMMENT 'operator user id',
  216. `operate_time` datetime DEFAULT NULL COMMENT 'operate time',
  217. `create_time` datetime NOT NULL COMMENT 'create time',
  218. `update_time` datetime NOT NULL COMMENT 'update time',
  219. PRIMARY KEY (`id`)
  220. ) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;
  221. -- ----------------------------
  222. -- Table structure for t_ds_task_definition
  223. -- ----------------------------
  224. DROP TABLE IF EXISTS `t_ds_task_definition`;
  225. CREATE TABLE `t_ds_task_definition` (
  226. `id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'self-increasing id',
  227. `code` bigint(20) NOT NULL COMMENT 'encoding',
  228. `name` varchar(200) DEFAULT NULL COMMENT 'task definition name',
  229. `version` int(11) DEFAULT '0' COMMENT 'task definition version',
  230. `description` text COMMENT 'description',
  231. `project_code` bigint(20) NOT NULL COMMENT 'project code',
  232. `user_id` int(11) DEFAULT NULL COMMENT 'task definition creator id',
  233. `task_type` varchar(50) NOT NULL COMMENT 'task type',
  234. `task_params` longtext COMMENT 'job custom parameters',
  235. `flag` tinyint(2) DEFAULT NULL COMMENT '0 not available, 1 available',
  236. `task_priority` tinyint(4) DEFAULT NULL COMMENT 'job priority',
  237. `worker_group` varchar(200) DEFAULT NULL COMMENT 'worker grouping',
  238. `environment_code` bigint(20) DEFAULT '-1' COMMENT 'environment code',
  239. `fail_retry_times` int(11) DEFAULT NULL COMMENT 'number of failed retries',
  240. `fail_retry_interval` int(11) DEFAULT NULL COMMENT 'failed retry interval',
  241. `timeout_flag` tinyint(2) DEFAULT '0' COMMENT 'timeout flag:0 close, 1 open',
  242. `timeout_notify_strategy` tinyint(4) DEFAULT NULL COMMENT 'timeout notification policy: 0 warning, 1 fail',
  243. `timeout` int(11) DEFAULT '0' COMMENT 'timeout length,unit: minute',
  244. `delay_time` int(11) DEFAULT '0' COMMENT 'delay execution time,unit: minute',
  245. `resource_ids` text COMMENT 'resource id, separated by comma',
  246. `create_time` datetime NOT NULL COMMENT 'create time',
  247. `update_time` datetime NOT NULL COMMENT 'update time',
  248. PRIMARY KEY (`id`,`code`)
  249. ) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;
  250. -- ----------------------------
  251. -- Table structure for t_ds_task_definition_log
  252. -- ----------------------------
  253. DROP TABLE IF EXISTS `t_ds_task_definition_log`;
  254. CREATE TABLE `t_ds_task_definition_log` (
  255. `id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'self-increasing id',
  256. `code` bigint(20) NOT NULL COMMENT 'encoding',
  257. `name` varchar(200) DEFAULT NULL COMMENT 'task definition name',
  258. `version` int(11) DEFAULT '0' COMMENT 'task definition version',
  259. `description` text COMMENT 'description',
  260. `project_code` bigint(20) NOT NULL COMMENT 'project code',
  261. `user_id` int(11) DEFAULT NULL COMMENT 'task definition creator id',
  262. `task_type` varchar(50) NOT NULL COMMENT 'task type',
  263. `task_params` text COMMENT 'job custom parameters',
  264. `flag` tinyint(2) DEFAULT NULL COMMENT '0 not available, 1 available',
  265. `task_priority` tinyint(4) DEFAULT NULL COMMENT 'job priority',
  266. `worker_group` varchar(200) DEFAULT NULL COMMENT 'worker grouping',
  267. `environment_code` bigint(20) DEFAULT '-1' COMMENT 'environment code',
  268. `fail_retry_times` int(11) DEFAULT NULL COMMENT 'number of failed retries',
  269. `fail_retry_interval` int(11) DEFAULT NULL COMMENT 'failed retry interval',
  270. `timeout_flag` tinyint(2) DEFAULT '0' COMMENT 'timeout flag:0 close, 1 open',
  271. `timeout_notify_strategy` tinyint(4) DEFAULT NULL COMMENT 'timeout notification policy: 0 warning, 1 fail',
  272. `timeout` int(11) DEFAULT '0' COMMENT 'timeout length,unit: minute',
  273. `delay_time` int(11) DEFAULT '0' COMMENT 'delay execution time,unit: minute',
  274. `resource_ids` text DEFAULT NULL COMMENT 'resource id, separated by comma',
  275. `operator` int(11) DEFAULT NULL COMMENT 'operator user id',
  276. `operate_time` datetime DEFAULT NULL COMMENT 'operate time',
  277. `create_time` datetime NOT NULL COMMENT 'create time',
  278. `update_time` datetime NOT NULL COMMENT 'update time',
  279. PRIMARY KEY (`id`)
  280. ) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;
  281. -- ----------------------------
  282. -- Table structure for t_ds_process_task_relation
  283. -- ----------------------------
  284. DROP TABLE IF EXISTS `t_ds_process_task_relation`;
  285. CREATE TABLE `t_ds_process_task_relation` (
  286. `id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'self-increasing id',
  287. `name` varchar(200) DEFAULT NULL COMMENT 'relation name',
  288. `project_code` bigint(20) NOT NULL COMMENT 'project code',
  289. `process_definition_code` bigint(20) NOT NULL COMMENT 'process code',
  290. `process_definition_version` int(11) NOT NULL COMMENT 'process version',
  291. `pre_task_code` bigint(20) NOT NULL COMMENT 'pre task code',
  292. `pre_task_version` int(11) NOT NULL COMMENT 'pre task version',
  293. `post_task_code` bigint(20) NOT NULL COMMENT 'post task code',
  294. `post_task_version` int(11) NOT NULL COMMENT 'post task version',
  295. `condition_type` tinyint(2) DEFAULT NULL COMMENT 'condition type : 0 none, 1 judge 2 delay',
  296. `condition_params` text COMMENT 'condition params(json)',
  297. `create_time` datetime NOT NULL COMMENT 'create time',
  298. `update_time` datetime NOT NULL COMMENT 'update time',
  299. PRIMARY KEY (`id`)
  300. ) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;
  301. -- ----------------------------
  302. -- Table structure for t_ds_process_task_relation_log
  303. -- ----------------------------
  304. DROP TABLE IF EXISTS `t_ds_process_task_relation_log`;
  305. CREATE TABLE `t_ds_process_task_relation_log` (
  306. `id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'self-increasing id',
  307. `name` varchar(200) DEFAULT NULL COMMENT 'relation name',
  308. `project_code` bigint(20) NOT NULL COMMENT 'project code',
  309. `process_definition_code` bigint(20) NOT NULL COMMENT 'process code',
  310. `process_definition_version` int(11) NOT NULL COMMENT 'process version',
  311. `pre_task_code` bigint(20) NOT NULL COMMENT 'pre task code',
  312. `pre_task_version` int(11) NOT NULL COMMENT 'pre task version',
  313. `post_task_code` bigint(20) NOT NULL COMMENT 'post task code',
  314. `post_task_version` int(11) NOT NULL COMMENT 'post task version',
  315. `condition_type` tinyint(2) DEFAULT NULL COMMENT 'condition type : 0 none, 1 judge 2 delay',
  316. `condition_params` text COMMENT 'condition params(json)',
  317. `operator` int(11) DEFAULT NULL COMMENT 'operator user id',
  318. `operate_time` datetime DEFAULT NULL COMMENT 'operate time',
  319. `create_time` datetime NOT NULL COMMENT 'create time',
  320. `update_time` datetime NOT NULL COMMENT 'update time',
  321. PRIMARY KEY (`id`)
  322. ) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;
  323. -- t_ds_command
  324. alter table t_ds_command change process_definition_id process_definition_code bigint(20) NOT NULL COMMENT 'process definition code';
  325. alter table t_ds_command add environment_code bigint(20) DEFAULT '-1' COMMENT 'environment code' AFTER worker_group;
  326. alter table t_ds_command add dry_run tinyint(4) DEFAULT '0' COMMENT 'dry run flag:0 normal, 1 dry run' AFTER environment_code;
  327. alter table t_ds_command add process_definition_version int(11) DEFAULT '0' COMMENT 'process definition version' AFTER process_definition_code;
  328. alter table t_ds_command add process_instance_id int(11) DEFAULT '0' COMMENT 'process instance id' AFTER process_definition_version;
  329. alter table t_ds_command add KEY `priority_id_index` (`process_instance_priority`,`id`) USING BTREE;
  330. -- t_ds_error_command
  331. alter table t_ds_error_command change process_definition_id process_definition_code bigint(20) NOT NULL COMMENT 'process definition code';
  332. alter table t_ds_error_command add environment_code bigint(20) DEFAULT '-1' COMMENT 'environment code' AFTER worker_group;
  333. alter table t_ds_error_command add dry_run tinyint(4) DEFAULT '0' COMMENT 'dry run flag:0 normal, 1 dry run' AFTER message;
  334. alter table t_ds_error_command add process_definition_version int(11) DEFAULT '0' COMMENT 'process definition version' AFTER process_definition_code;
  335. alter table t_ds_error_command add process_instance_id int(11) DEFAULT '0' COMMENT 'process instance id' AFTER process_definition_version;
  336. -- t_ds_process_instance note: Data migration is not supported
  337. alter table t_ds_process_instance change process_definition_id process_definition_code bigint(20) NOT NULL COMMENT 'process definition code';
  338. alter table t_ds_process_instance add process_definition_version int(11) DEFAULT '0' COMMENT 'process definition version' AFTER process_definition_code;
  339. alter table t_ds_process_instance add environment_code bigint(20) DEFAULT '-1' COMMENT 'environment code' AFTER worker_group;
  340. alter table t_ds_process_instance add var_pool longtext COMMENT 'var_pool' AFTER tenant_id;
  341. alter table t_ds_process_instance add dry_run tinyint(4) DEFAULT '0' COMMENT 'dry run flag:0 normal, 1 dry run' AFTER var_pool;
  342. alter table t_ds_process_instance drop KEY `process_instance_index`;
  343. alter table t_ds_process_instance add KEY `process_instance_index` (`process_definition_code`,`id`) USING BTREE;
  344. alter table t_ds_process_instance drop process_instance_json;
  345. alter table t_ds_process_instance drop locations;
  346. alter table t_ds_process_instance drop connects;
  347. alter table t_ds_process_instance drop dependence_schedule_times;
  348. -- t_ds_task_instance note: Data migration is not supported
  349. alter table t_ds_task_instance change process_definition_id task_code bigint(20) NOT NULL COMMENT 'task definition code';
  350. alter table t_ds_task_instance add task_definition_version int(11) DEFAULT '0' COMMENT 'task definition version' AFTER task_code;
  351. alter table t_ds_task_instance add task_params text COMMENT 'job custom parameters' AFTER app_link;
  352. alter table t_ds_task_instance add environment_code bigint(20) DEFAULT '-1' COMMENT 'environment code' AFTER worker_group;
  353. alter table t_ds_task_instance add environment_config text COMMENT 'this config contains many environment variables config' AFTER environment_code;
  354. alter table t_ds_task_instance add first_submit_time datetime DEFAULT NULL COMMENT 'task first submit time' AFTER executor_id;
  355. alter table t_ds_task_instance add delay_time int(4) DEFAULT '0' COMMENT 'task delay execution time' AFTER first_submit_time;
  356. alter table t_ds_task_instance add var_pool longtext COMMENT 'var_pool' AFTER delay_time;
  357. alter table t_ds_task_instance add dry_run tinyint(4) DEFAULT '0' COMMENT 'dry run flag:0 normal, 1 dry run' AFTER var_pool;
  358. alter table t_ds_task_instance drop KEY `task_instance_index`;
  359. alter table t_ds_task_instance drop task_json;
  360. -- t_ds_schedules
  361. alter table t_ds_schedules change process_definition_id process_definition_code bigint(20) NOT NULL COMMENT 'process definition code';
  362. alter table t_ds_schedules add timezone_id varchar(40) DEFAULT NULL COMMENT 'timezoneId' AFTER end_time;
  363. alter table t_ds_schedules add environment_code bigint(20) DEFAULT '-1' COMMENT 'environment code' AFTER worker_group;
  364. -- t_ds_process_definition
  365. alter table t_ds_process_definition add `code` bigint(20) NOT NULL COMMENT 'encoding' AFTER `id`;
  366. alter table t_ds_process_definition change project_id project_code bigint(20) NOT NULL COMMENT 'project code' AFTER `description`;
  367. alter table t_ds_process_definition add `warning_group_id` int(11) DEFAULT NULL COMMENT 'alert group id' AFTER `locations`;
  368. alter table t_ds_process_definition add UNIQUE KEY `process_unique` (`name`,`project_code`) USING BTREE;
  369. alter table t_ds_process_definition modify `description` text COMMENT 'description' after `version`;
  370. alter table t_ds_process_definition modify `release_state` tinyint(4) DEFAULT NULL COMMENT 'process definition release state:0:offline,1:online' after `project_code`;
  371. alter table t_ds_process_definition modify `create_time` datetime DEFAULT NULL COMMENT 'create time' after `tenant_id`;