ruanwenjun commented on code in PR #17513:
URL: 
https://github.com/apache/dolphinscheduler/pull/17513#discussion_r2352813427


##########
dolphinscheduler-dao/src/main/resources/sql/upgrade/3.3.0_schema/postgresql/dolphinscheduler_ddl.sql:
##########
@@ -235,6 +235,7 @@ DROP FUNCTION IF EXISTS drop_data_quality_tables();
 
 create index workflow_definition_index_project_code on 
t_ds_workflow_definition (project_code);
 create index workflow_definition_log_index_project_code on 
t_ds_workflow_definition_log (project_code);
+create unique index idx_code on t_ds_schedules (process_definition_code);

Review Comment:
   ```suggestion
   create unique index uniq_workflow_definition_code on t_ds_schedules 
(process_definition_code);
   ```



##########
dolphinscheduler-dao/src/main/resources/sql/upgrade/3.3.0_schema/mysql/dolphinscheduler_ddl.sql:
##########
@@ -225,6 +225,7 @@ DROP PROCEDURE drop_data_quality_tables;
 
 ALTER TABLE `t_ds_workflow_definition` ADD KEY `idx_project_code` 
(`project_code`) USING BTREE;
 ALTER TABLE `t_ds_workflow_definition_log` ADD KEY `idx_project_code` 
(`project_code`) USING BTREE;
+ALTER TABLE `t_ds_schedules` ADD UNIQUE KEY `idx_code` 
(`process_definition_code`) USING BTREE;

Review Comment:
   ```suggestion
   ALTER TABLE `t_ds_schedules` ADD UNIQUE KEY `uniq_workflow_definition_code` 
(`process_definition_code`) USING BTREE;
   ```



##########
dolphinscheduler-dao/src/main/resources/sql/dolphinscheduler_postgresql.sql:
##########
@@ -767,7 +767,8 @@ CREATE TABLE t_ds_schedules (
   environment_code bigint DEFAULT '-1',
   create_time timestamp NOT NULL ,
   update_time timestamp NOT NULL ,
-  PRIMARY KEY (id)
+  PRIMARY KEY (id),
+  CONSTRAINT workflow_definition_code_unique UNIQUE (workflow_definition_code)

Review Comment:
   ```suggestion
     PRIMARY KEY (id)
   ```
   CREATE UNIQUE INDEX uniq_workflow_definition_code ON t_ds_schedules 
(process_definition_code);



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to