diff options
author | Wendell Sun <iwendellsun@gmail.com> | 2018-02-21 09:38:03 +0800 |
---|---|---|
committer | Bo-Yi Wu <appleboy.tw@gmail.com> | 2018-02-21 09:38:03 +0800 |
commit | 2f5c1ba1db39648e4be9a2905dcec09c45dbb269 (patch) | |
tree | e78cd5bc35e9b93d60c0b819c279bd20ad34ddc5 /models/release.go | |
parent | 7b104f0cd03cf3df2b10f6f447857fe389654df1 (diff) | |
download | gitea-2f5c1ba1db39648e4be9a2905dcec09c45dbb269.tar.gz gitea-2f5c1ba1db39648e4be9a2905dcec09c45dbb269.zip |
Bug fix for repo releases sorted (#3522)
Signed-off-by: Wendell Sun <iwendellsun@gmail.com>
Use TimeStampNow function
Diffstat (limited to 'models/release.go')
-rw-r--r-- | models/release.go | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/models/release.go b/models/release.go index 1e1d339a7c..66202615d2 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 } |