Skip to content

Conversation

@ruanwenjun
Copy link
Member

Purpose of the pull request

close #17142

Brief change log

  • Add uk in t_ds_workflow_definition to make sure the code unique
  • Add upgrade ddl on 3.3.1

Verify this pull request

This pull request is code cleanup without any test coverage.

(or)

This pull request is already covered by existing tests, such as (please describe tests).

(or)

This change added tests and can be verified as follows:

(or)

Pull Request Notice

Pull Request Notice

If your pull request contains incompatible change, you should also add it to docs/docs/en/guide/upgrade/incompatible.md

@ruanwenjun ruanwenjun requested a review from EricGao888 as a code owner April 26, 2025 02:46
@ruanwenjun ruanwenjun force-pushed the dev_wenjun_removeChannelLock branch from 6c16f48 to c86eea1 Compare April 27, 2025 01:40
@ruanwenjun ruanwenjun changed the title Add UK uniq_workflow_definition_code on t_ds_workflow_definition [Fix-17142] Add UK uniq_workflow_definition_code on t_ds_workflow_definition Apr 29, 2025
@ruanwenjun ruanwenjun added this to the 3.3.1 milestone Apr 29, 2025
@ruanwenjun ruanwenjun added the bug Something isn't working label Apr 29, 2025
Copy link
Member

@SbloodyS SbloodyS left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@nielifeng nielifeng requested a review from Copilot May 9, 2025 09:49
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This pull request updates the workflow definition table schema by introducing a unique constraint on the code column and adjusting primary key definitions to ensure uniqueness. The key changes include:

  • Adding a unique index (uniq_workflow_definition_code) on the code column in PostgreSQL, MySQL, and H2.
  • Dropping the code component from the composite primary key in MySQL.
  • Updating index creation statements to align with the new unique constraint.

Reviewed Changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated no comments.

Show a summary per file
File Description
dolphinscheduler-dao/src/main/resources/sql/upgrade/3.3.1_schema/postgresql/dolphinscheduler_dml.sql Added license header only.
dolphinscheduler-dao/src/main/resources/sql/upgrade/3.3.1_schema/postgresql/dolphinscheduler_ddl.sql Added drop and create unique index statements for PostgreSQL.
dolphinscheduler-dao/src/main/resources/sql/upgrade/3.3.1_schema/mysql/dolphinscheduler_dml.sql Added license header only.
dolphinscheduler-dao/src/main/resources/sql/upgrade/3.3.1_schema/mysql/dolphinscheduler_ddl.sql Dropped composite primary key and added unique key constraint in MySQL.
dolphinscheduler-dao/src/main/resources/sql/dolphinscheduler_postgresql.sql Replaced non-unique index with a unique index in PostgreSQL schema.
dolphinscheduler-dao/src/main/resources/sql/dolphinscheduler_mysql.sql Updated the primary key and added the unique index in MySQL schema.
dolphinscheduler-dao/src/main/resources/sql/dolphinscheduler_h2.sql Renamed the unique key for consistency in H2 schema.
Comments suppressed due to low confidence (2)

dolphinscheduler-dao/src/main/resources/sql/upgrade/3.3.1_schema/mysql/dolphinscheduler_ddl.sql:18

  • Dropping the composite primary key that includes 'code' is a significant schema change. Please verify that this alteration does not negatively impact database relationships or query performance, especially if any foreign keys or logic rely on the unique combination of (id, code).
ALTER TABLE t_ds_workflow_definition DROP PRIMARY KEY;

dolphinscheduler-dao/src/main/resources/sql/dolphinscheduler_mysql.sql:429

  • Changing the primary key from a composite key (id, code) to a single-column primary key (id) may affect queries or constraints that depend on the composite key. Please confirm that all dependent application logic and database relationships have been updated accordingly.
PRIMARY KEY (`id`),

@ruanwenjun ruanwenjun force-pushed the dev_wenjun_removeChannelLock branch from c86eea1 to ddd1d52 Compare May 9, 2025 14:07
@ruanwenjun ruanwenjun force-pushed the dev_wenjun_removeChannelLock branch from ddd1d52 to af9bcda Compare May 12, 2025 14:21
@sonarqubecloud
Copy link

@ruanwenjun ruanwenjun merged commit 43a27e1 into apache:dev May 12, 2025
70 checks passed
@ruanwenjun ruanwenjun deleted the dev_wenjun_removeChannelLock branch May 12, 2025 15:45
davidzollo pushed a commit to davidzollo/dolphinscheduler that referenced this pull request Oct 27, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backend bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] [Schema] The primary key of table t_ds_workflow_definition should be id rather than id,code

3 participants