You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@dolphinscheduler.apache.org by GitBox <gi...@apache.org> on 2022/09/21 08:21:10 UTC

[GitHub] [dolphinscheduler] caishunfeng commented on a diff in pull request #12076: [Feature-10495][Resource Center] Resource Center Refactor

caishunfeng commented on code in PR #12076:
URL: https://github.com/apache/dolphinscheduler/pull/12076#discussion_r976190640


##########
dolphinscheduler-dao/src/main/resources/sql/dolphinscheduler_mysql.sql:
##########
@@ -790,6 +790,22 @@ CREATE TABLE `t_ds_resources` (
 -- Records of t_ds_resources
 -- ----------------------------
 
+-- ----------------------------
+-- Table structure for t_ds_relation_resources_task
+-- ----------------------------
+DROP TABLE IF EXISTS `t_ds_relation_resources_task`;
+CREATE TABLE `t_ds_relation_resources_task` (
+  `id` int NOT NULL AUTO_INCREMENT COMMENT 'key',
+  `full_name` varchar(255) DEFAULT NULL,
+  `type` tinyint DEFAULT NULL COMMENT 'resource type,0:FILE,1:UDF',
+  PRIMARY KEY (`id`),
+  UNIQUE KEY `t_ds_relation_resources_task_un` (`full_name`,`type`)
+) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb3

Review Comment:
   I think this table is about resources, not the relation between task and resources.
   Why not create this table like this, and then we can remove the `resource_ids_new` field in `t_ds_task_definition`
   ```suggestion
   CREATE TABLE `t_ds_relation_resources_task` (
     `id` int NOT NULL AUTO_INCREMENT COMMENT 'key',
     `task_id` int(11) DEFAULT NULL COMMENT 'task id',
     `full_name` varchar(255) DEFAULT NULL,
     `type` tinyint DEFAULT NULL COMMENT 'resource type,0:FILE,1:UDF',
     PRIMARY KEY (`id`),
     UNIQUE KEY `t_ds_relation_resources_task_un` (`task_id`, `full_name`,`type`)
   ) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb3
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@dolphinscheduler.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org