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/10/25 02:22:16 UTC

[GitHub] [dolphinscheduler] zhongjiajie commented on a diff in pull request #12503: [fix-12504][sql] Add unique key to t_ds_process_definition_log

zhongjiajie commented on code in PR #12503:
URL: https://github.com/apache/dolphinscheduler/pull/12503#discussion_r1003931979


##########
dolphinscheduler-dao/src/main/resources/sql/dolphinscheduler_postgresql.sql:
##########
@@ -379,6 +379,8 @@ CREATE TABLE t_ds_process_definition_log (
   PRIMARY KEY (id)
 ) ;
 
+create UNIQUE index idx_process_definition_log_code_version on t_ds_process_definition_log (code,version);

Review Comment:
   Should we keep the same name as other database type?
   ```suggestion
   create UNIQUE index uniq_idx_code_version on t_ds_process_definition_log (code,version);
   ```



##########
dolphinscheduler-dao/src/main/resources/sql/upgrade/3.2.0_schema/postgresql/dolphinscheduler_ddl.sql:
##########
@@ -118,4 +118,7 @@ $$ LANGUAGE plpgsql;
 d//
 delimiter ;
 select uc_dolphin_T_t_ds_task_instance_R_test_flag();
-DROP FUNCTION uc_dolphin_T_t_ds_task_instance_R_test_flag();
\ No newline at end of file
+DROP FUNCTION uc_dolphin_T_t_ds_task_instance_R_test_flag();
+
+
+create UNIQUE index IF NOT EXISTS idx_process_definition_log_code_version on t_ds_process_definition_log (code,version);

Review Comment:
   tips, do not forget to change the unique index name when we change it in `dolphinscheduler_postgresql.sql`



##########
dolphinscheduler-dao/src/main/resources/sql/upgrade/3.2.0_schema/mysql/dolphinscheduler_ddl.sql:
##########
@@ -119,4 +119,24 @@ d//
 
 delimiter ;
 CALL uc_dolphin_T_t_ds_task_instance_R_test_flag;
-DROP PROCEDURE uc_dolphin_T_t_ds_task_instance_R_test_flag;
\ No newline at end of file
+DROP PROCEDURE uc_dolphin_T_t_ds_task_instance_R_test_flag;
+
+-- add unique key to t_ds_process_definition_log
+drop PROCEDURE if EXISTS add_t_ds_process_definition_log_uk_uniq_idx_code_version;
+delimiter d//
+CREATE PROCEDURE add_t_ds_process_definition_log_uk_uniq_idx_code_version()
+BEGIN

Review Comment:
   we have a discuss here, I think is a bug, and we should put it in version 3.1.1 instead of 3.2.0, WDTY @caishunfeng @EricGao888 



-- 
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