Browse Source

migrations: set comment updated as created

tags/v0.9.99
Unknwon 7 years ago
parent
commit
bb359a74f1
6 changed files with 25 additions and 4 deletions
  1. 1
    1
      README.md
  2. 1
    1
      gogs.go
  3. 1
    1
      models/issue_comment.go
  4. 3
    0
      models/migrations/migrations.go
  5. 18
    0
      models/migrations/v14.go
  6. 1
    1
      templates/.VERSION

+ 1
- 1
README.md View File



![](https://github.com/gogits/gogs/blob/master/public/img/gogs-large-resize.png?raw=true) ![](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 | | Web | UI | Preview |
|:-------------:|:-------:|:-------:| |:-------------:|:-------:|:-------:|

+ 1
- 1
gogs.go View File

"github.com/gogits/gogs/modules/setting" "github.com/gogits/gogs/modules/setting"
) )


const APP_VER = "0.9.86.0826"
const APP_VER = "0.9.87.0826"


func init() { func init() {
runtime.GOMAXPROCS(runtime.NumCPU()) runtime.GOMAXPROCS(runtime.NumCPU())

+ 1
- 1
models/issue_comment.go View File

comments := make([]*Comment, 0, 10) comments := make([]*Comment, 0, 10)
sess := e.Where("issue_id = ?", issueID).Asc("created_unix") sess := e.Where("issue_id = ?", issueID).Asc("created_unix")
if since > 0 { if since > 0 {
sess.And("created_unix >= ?", since)
sess.And("updated_unix >= ?", since)
} }
return comments, sess.Find(&comments) return comments, sess.Find(&comments)
} }

+ 3
- 0
models/migrations/migrations.go View File

NewMigration("generate rands and salt for organizations", generateOrgRandsAndSalt), // V10 -> V11:v0.8.5 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 date to unix timestamp", convertDateToUnix), // V11 -> V12:v0.9.2
NewMigration("convert LDAP UseSSL option to SecurityProtocol", ldapUseSSLToSecurityProtocol), // V12 -> V13:v0.9.37 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 // Migrate database to current version

+ 18
- 0
models/migrations/v14.go View File

// 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
}

+ 1
- 1
templates/.VERSION View File

0.9.86.0826
0.9.87.0826

Loading…
Cancel
Save