-
Notifications
You must be signed in to change notification settings - Fork 4.6k
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
[bug][db] Table relation_project_user have duplicate record #9536
Conversation
...heduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/UsersServiceImpl.java
Outdated
Show resolved
Hide resolved
dolphinscheduler-dao/src/main/resources/sql/dolphinscheduler_postgresql.sql
Show resolved
Hide resolved
Codecov Report
@@ Coverage Diff @@
## dev #9536 +/- ##
============================================
+ Coverage 39.98% 40.02% +0.04%
- Complexity 4432 4477 +45
============================================
Files 831 835 +4
Lines 33314 33583 +269
Branches 3677 3715 +38
============================================
+ Hits 13320 13443 +123
- Misses 18766 18886 +120
- Partials 1228 1254 +26
Continue to review full report at Codecov.
|
dolphinscheduler-dao/src/main/resources/sql/dolphinscheduler_postgresql.sql
Outdated
Show resolved
Hide resolved
...cheduler-dao/src/main/resources/sql/upgrade/2.0.6_schema/postgresql/dolphinscheduler_ddl.sql
Outdated
Show resolved
Hide resolved
...heduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/UsersServiceImpl.java
Outdated
Show resolved
Hide resolved
...heduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/UsersServiceImpl.java
Outdated
Show resolved
Hide resolved
...heduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/UsersServiceImpl.java
Outdated
Show resolved
Hide resolved
...heduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/UsersServiceImpl.java
Outdated
Show resolved
Hide resolved
...heduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/UsersServiceImpl.java
Outdated
Show resolved
Hide resolved
...heduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/UsersServiceImpl.java
Outdated
Show resolved
Hide resolved
@@ -57,3 +57,8 @@ d// | |||
delimiter ; | |||
CALL uc_dolphin_T_t_ds_alert_R_sign; | |||
DROP PROCEDURE uc_dolphin_T_t_ds_alert_R_sign; | |||
|
|||
-- add unique key to t_ds_relation_project_user | |||
ALTER TABLE t_ds_relation_project_user ADD UNIQUE KEY uniq_uid_pid(user_id,project_id); |
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.
i think we should add to new SQL directory named 3.0.0
?
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.
i think we should add to new SQL directory named
3.0.0
?
It's a bug fix. I think it should be included in 2.0.6-release. WDYT? @zhongjiajie
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.
In general, I think change targe branch with dev
database change should add to 3.0.0_schema, and committer judge whether should release in bug fix version. If it is only put in 2.0.5 and not in 3.0.0, it may be that the 3.0.0-bate release will miss this commit.
But in case, dev
branch without 3.0.0_schema
folder,(and that is my wrong, i forgot to add it after 3.0.0-release) so i think it could change into 2.0.6 or 3.0.0
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.
In general, I think change targe branch with
dev
database change should add to 3.0.0_schema, and committer judge whether should release in bug fix version. If it is only put in 2.0.5 and not in 3.0.0, it may be that the 3.0.0-bate release will miss this commit.But in case,
dev
branch without3.0.0_schema
folder,(and that is my wrong, i forgot to add it after 3.0.0-release) so i think it could change into 2.0.6 or 3.0.0
I agree with you. @zhongjiajie
...heduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/UsersServiceImpl.java
Outdated
Show resolved
Hide resolved
code LGTM, but we still have discussion in #9536 (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.
not necessarily to change
// 4. maintain the relationship between project and user if not exists | ||
ProjectUser projectUser = projectUserMapper.queryProjectRelation(project.getId(), userId); | ||
if (projectUser == null) { | ||
final Date today = new Date(); |
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.
Maybe the final identifier is not needed?
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.
I agree. I try to remove it
Kudos, SonarCloud Quality Gate passed! |
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, thanks~
Purpose of the pull request
refer to issue close #9290
Brief change log
Verify this pull request
This pull request is code cleanup without any test coverage.