Browse Source

#2727 make IN clause compatible with Postgres

Unknwon 9 years ago
parent
commit
97429a25ab
4 changed files with 6 additions and 6 deletions
  1. 1 1
      README.md
  2. 1 1
      gogs.go
  3. 3 3
      models/org.go
  4. 1 1
      templates/.VERSION

+ 1 - 1
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 version: 0.8.49
+##### Current version: 0.8.50
 
 | Web | UI  | Preview  |
 |:-------------:|:-------:|:-------:|

+ 1 - 1
gogs.go

@@ -17,7 +17,7 @@ import (
 	"github.com/gogits/gogs/modules/setting"
 )
 
-const APP_VER = "0.8.49.0229"
+const APP_VER = "0.8.50.0301"
 
 func init() {
 	runtime.GOMAXPROCS(runtime.NumCPU())

+ 3 - 3
models/org.go

@@ -1060,7 +1060,7 @@ func (org *User) GetUserRepositories(userID int64) (err error) {
 		And("`team_user`.uid=?", userID).
 		Join("INNER", "`team_user`", "`team_user`.team_id=`team`.id").
 		Find(&teams); err != nil {
-		return fmt.Errorf("GetUserRepositories: get teams: %v", err)
+		return fmt.Errorf("get teams: %v", err)
 	}
 
 	teamIDs := make([]string, len(teams))
@@ -1080,10 +1080,10 @@ func (org *User) GetUserRepositories(userID int64) (err error) {
 		Join("INNER", "`team_repo`", "`team_repo`.repo_id=`repository`.id").
 		Where("`repository`.owner_id=?", org.Id).
 		And("`repository`.is_private=?", false).
-		Or("`team_repo`.team_id=(?)", strings.Join(teamIDs, ",")).
+		Or("`team_repo`.team_id IN (?)", strings.Join(teamIDs, ",")).
 		GroupBy("`repository`.id").
 		Find(&org.Repos); err != nil {
-		return fmt.Errorf("GetUserRepositories: get repositories: %v", err)
+		return fmt.Errorf("get repositories: %v", err)
 	}
 
 	// FIXME: should I change this value inside method,

+ 1 - 1
templates/.VERSION

@@ -1 +1 @@
-0.8.49.0229
+0.8.50.0301