From 423c642fdb8e15c6cb77a90f54f377e0e894f77b Mon Sep 17 00:00:00 2001 From: Wendell Sun Date: Thu, 22 Feb 2018 09:56:38 +0800 Subject: [PATCH] Bug fix for repo releases sorted (#3522) (#3555) 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 1e1d339a7..66202615d 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 }