Skip to content

Fix issue #1730 - Now all actions are modified - #1744

Closed
DblK wants to merge 1 commit into
go-gitea:masterfrom
DblK:feature_FixActivityWhenUserRename
Closed

Fix issue #1730 - Now all actions are modified#1744
DblK wants to merge 1 commit into
go-gitea:masterfrom
DblK:feature_FixActivityWhenUserRename

Conversation

@DblK

@DblK DblK commented May 17, 2017

Copy link
Copy Markdown
Member

Action in Dashboard are renamed when the user is renamed. This fix #1730.

Comment thread models/action.go
Cols("act_user_name", "repo_user_name").
Where("act_user_id = ?", id).
Update(ac)
log.Info("%v", err)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

err maybe nil

@DblK DblK May 18, 2017

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I will remove this line

Comment thread models/action.go
ActUserName: newUserName,
}
_, err := x.
Cols("act_user_name", "repo_user_name").

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Should only update act_user_name. And add another SQL update action set repo_user_name=? where repo_user_name=?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

It won't be possible because I don't have the oldUserName, you want me to add it to the function?
I am not sure to understand how you want me to code it.

@lunny

lunny commented May 18, 2017

Copy link
Copy Markdown
Member

And a migration should be added

@tboerger tboerger added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label May 18, 2017
@lunny lunny added the type/bug label May 18, 2017
@lunny lunny added this to the 1.2.0 milestone May 18, 2017
@DblK

DblK commented May 18, 2017

Copy link
Copy Markdown
Member Author

What migration should I do?
Update act_user_name according to the username of the act_user_id?

I have a hard time coding the migration but I can try to do it.

@lunny

lunny commented May 22, 2017

Copy link
Copy Markdown
Member

Maybe you should add a migration like the below.

x.Exec("update action set act_user_name = (select name from user where user.id = action.act_user_id)")

@lunny lunny mentioned this pull request May 23, 2017
@DblK

DblK commented May 23, 2017

Copy link
Copy Markdown
Member Author

Since #1779 try to achieve the same thing in other way, I will close this PR in favor of this other.
@lunny what do you think?

@lunny

lunny commented May 23, 2017

Copy link
Copy Markdown
Member

@DblK I agree with you.

@DblK DblK closed this May 23, 2017
@lunny lunny removed this from the 1.2.0 milestone May 24, 2017
@lunny lunny added issue/duplicate The issue has already been reported. and removed type/bug labels May 24, 2017
@go-gitea go-gitea locked and limited conversation to collaborators Nov 23, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

issue/duplicate The issue has already been reported. lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Activity Feed is not updated after username-change

3 participants