diff --git a/README.md b/README.md index c3b250e73..8075d4020 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@ Gogs - Go Git Service [![Build Status](https://travis-ci.org/gogits/gogs.svg?bra ![](https://github.com/gogits/gogs/blob/master/public/img/gogs-large-resize.png?raw=true) -##### Current tip version: 0.9.86 (see [Releases](https://github.com/gogits/gogs/releases) for binary versions) +##### Current tip version: 0.9.87 (see [Releases](https://github.com/gogits/gogs/releases) for binary versions) | Web | UI | Preview | |:-------------:|:-------:|:-------:| diff --git a/gogs.go b/gogs.go index 1874c4d0a..d9601ece9 100644 --- a/gogs.go +++ b/gogs.go @@ -17,7 +17,7 @@ import ( "github.com/gogits/gogs/modules/setting" ) -const APP_VER = "0.9.86.0826" +const APP_VER = "0.9.87.0826" func init() { runtime.GOMAXPROCS(runtime.NumCPU()) diff --git a/models/issue_comment.go b/models/issue_comment.go index c914e0a56..ccfa765f9 100644 --- a/models/issue_comment.go +++ b/models/issue_comment.go @@ -358,7 +358,7 @@ func getCommentsByIssueIDSince(e Engine, issueID, since int64) ([]*Comment, erro comments := make([]*Comment, 0, 10) sess := e.Where("issue_id = ?", issueID).Asc("created_unix") if since > 0 { - sess.And("created_unix >= ?", since) + sess.And("updated_unix >= ?", since) } return comments, sess.Find(&comments) } diff --git a/models/migrations/migrations.go b/models/migrations/migrations.go index 6a1fb2f6d..5f1896076 100644 --- a/models/migrations/migrations.go +++ b/models/migrations/migrations.go @@ -68,6 +68,9 @@ var migrations = []Migration{ NewMigration("generate rands and salt for organizations", generateOrgRandsAndSalt), // V10 -> V11:v0.8.5 NewMigration("convert date to unix timestamp", convertDateToUnix), // V11 -> V12:v0.9.2 NewMigration("convert LDAP UseSSL option to SecurityProtocol", ldapUseSSLToSecurityProtocol), // V12 -> V13:v0.9.37 + + // v13 -> v14:v0.9.87 + NewMigration("set comment updated with created", setCommentUpdatedWithCreated), } // Migrate database to current version diff --git a/models/migrations/v14.go b/models/migrations/v14.go new file mode 100644 index 000000000..16c497e7e --- /dev/null +++ b/models/migrations/v14.go @@ -0,0 +1,18 @@ +// Copyright 2016 The Gogs Authors. All rights reserved. +// Use of this source code is governed by a MIT-style +// license that can be found in the LICENSE file. + +package migrations + +import ( + "fmt" + + "github.com/go-xorm/xorm" +) + +func setCommentUpdatedWithCreated(x *xorm.Engine) error { + if _, err := x.Exec("UPDATE comment SET updated_unix = created_unix"); err != nil { + return fmt.Errorf("set update_unix: %v", err) + } + return nil +} diff --git a/templates/.VERSION b/templates/.VERSION index 179fe9808..0337cf7ae 100644 --- a/templates/.VERSION +++ b/templates/.VERSION @@ -1 +1 @@ -0.9.86.0826 \ No newline at end of file +0.9.87.0826 \ No newline at end of file