diff options
author | Lunny Xiao <xiaolunwen@gmail.com> | 2017-09-25 12:59:27 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-09-25 12:59:27 +0800 |
commit | dd55534b82ca9527b68fddf0f63ebb13c105c466 (patch) | |
tree | 5e1398ac3d07da8b7e4cb4fdd52695cea19b62b7 /models/issue_milestone.go | |
parent | 6b6f16cfae5636deb88003fc5b0290450afb4137 (diff) | |
download | gitea-dd55534b82ca9527b68fddf0f63ebb13c105c466.tar.gz gitea-dd55534b82ca9527b68fddf0f63ebb13c105c466.zip |
Reduce usage of allcols on update (#2596)
* reduce usage of allcols on update
* fix bug and tests
Diffstat (limited to 'models/issue_milestone.go')
-rw-r--r-- | models/issue_milestone.go | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/models/issue_milestone.go b/models/issue_milestone.go index d12c309b87..0001da90ef 100644 --- a/models/issue_milestone.go +++ b/models/issue_milestone.go @@ -227,7 +227,7 @@ func ChangeMilestoneStatus(m *Milestone, isClosed bool) (err error) { repo.NumMilestones = int(countRepoMilestones(sess, repo.ID)) repo.NumClosedMilestones = int(countRepoClosedMilestones(sess, repo.ID)) - if _, err = sess.Id(repo.ID).AllCols().Update(repo); err != nil { + if _, err = sess.Id(repo.ID).Cols("num_milestones, num_closed_milestones").Update(repo); err != nil { return err } return sess.Commit() @@ -341,7 +341,7 @@ func DeleteMilestoneByRepoID(repoID, id int64) error { repo.NumMilestones = int(countRepoMilestones(sess, repo.ID)) repo.NumClosedMilestones = int(countRepoClosedMilestones(sess, repo.ID)) - if _, err = sess.Id(repo.ID).AllCols().Update(repo); err != nil { + if _, err = sess.Id(repo.ID).Cols("num_milestones, num_closed_milestones").Update(repo); err != nil { return err } |