-
Notifications
You must be signed in to change notification settings - Fork 5k
[Fix-17142] Add UK uniq_workflow_definition_code on t_ds_workflow_definition #17151
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Fix-17142] Add UK uniq_workflow_definition_code on t_ds_workflow_definition #17151
Conversation
6c16f48 to
c86eea1
Compare
SbloodyS
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this 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`),
c86eea1 to
ddd1d52
Compare
ddd1d52 to
af9bcda
Compare
|



Purpose of the pull request
close #17142
Brief change log
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