summaryrefslogtreecommitdiffstats
path: root/models/issue.go
diff options
context:
space:
mode:
authorLauris BH <lauris@nix.lv>2018-02-19 04:39:26 +0200
committerBo-Yi Wu <appleboy.tw@gmail.com>2018-02-19 10:39:26 +0800
commit58893384e848b54687c21d6d2ca38b70b3036ae2 (patch)
tree343c231b40e378ccd089fc7796401f1459fdc1a2 /models/issue.go
parentfb2c176491ebc0f18e6ef25038ca84db561539e2 (diff)
downloadgitea-58893384e848b54687c21d6d2ca38b70b3036ae2.tar.gz
gitea-58893384e848b54687c21d6d2ca38b70b3036ae2.zip
Add issue closed time column to fix activity closed issues list (#3537)
Signed-off-by: Lauris Bukšis-Haberkorns <lauris@nix.lv>
Diffstat (limited to 'models/issue.go')
-rw-r--r--models/issue.go8
1 files changed, 7 insertions, 1 deletions
diff --git a/models/issue.go b/models/issue.go
index d10c521db6..9106db281a 100644
--- a/models/issue.go
+++ b/models/issue.go
@@ -49,6 +49,7 @@ type Issue struct {
DeadlineUnix util.TimeStamp `xorm:"INDEX"`
CreatedUnix util.TimeStamp `xorm:"INDEX created"`
UpdatedUnix util.TimeStamp `xorm:"INDEX updated"`
+ ClosedUnix util.TimeStamp `xorm:"INDEX"`
Attachments []*Attachment `xorm:"-"`
Comments []*Comment `xorm:"-"`
@@ -612,8 +613,13 @@ func (issue *Issue) changeStatus(e *xorm.Session, doer *User, repo *Repository,
return nil
}
issue.IsClosed = isClosed
+ if isClosed {
+ issue.ClosedUnix = util.TimeStampNow()
+ } else {
+ issue.ClosedUnix = 0
+ }
- if err = updateIssueCols(e, issue, "is_closed"); err != nil {
+ if err = updateIssueCols(e, issue, "is_closed", "closed_unix"); err != nil {
return err
}