mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2025-06-21 22:08:37 -04:00
Reduce usage of allcols on update (#2596)
* reduce usage of allcols on update * fix bug and tests
This commit is contained in:
parent
6b6f16cfae
commit
dd55534b82
10 changed files with 21 additions and 25 deletions
|
@ -143,7 +143,7 @@ func (repo *Repository) ChangeCollaborationAccessMode(uid int64, mode AccessMode
|
|||
|
||||
if _, err = sess.
|
||||
Id(collaboration.ID).
|
||||
AllCols().
|
||||
Cols("mode").
|
||||
Update(collaboration); err != nil {
|
||||
return fmt.Errorf("update collaboration: %v", err)
|
||||
} else if _, err = sess.Exec("UPDATE access SET mode = ? WHERE user_id = ? AND repo_id = ?", mode, uid, repo.ID); err != nil {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue