From 2f5c1ba1db39648e4be9a2905dcec09c45dbb269 Mon Sep 17 00:00:00 2001 From: Wendell Sun Date: Wed, 21 Feb 2018 09:38:03 +0800 Subject: [PATCH] Bug fix for repo releases sorted (#3522) Signed-off-by: Wendell Sun Use TimeStampNow function --- models/release.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/models/release.go b/models/release.go index 1e1d339a7cb..66202615d2a 100644 --- a/models/release.go +++ b/models/release.go @@ -36,7 +36,7 @@ type Release struct { IsPrerelease bool `xorm:"NOT NULL DEFAULT false"` IsTag bool `xorm:"NOT NULL DEFAULT false"` Attachments []*Attachment `xorm:"-"` - CreatedUnix util.TimeStamp `xorm:"created INDEX"` + CreatedUnix util.TimeStamp `xorm:"INDEX"` } func (r *Release) loadAttributes(e Engine) error { @@ -134,6 +134,8 @@ func createTag(gitRepo *git.Repository, rel *Release) error { if err != nil { return fmt.Errorf("CommitsCount: %v", err) } + } else { + rel.CreatedUnix = util.TimeStampNow() } return nil }