summaryrefslogtreecommitdiffstats
path: root/models/org.go
diff options
context:
space:
mode:
authorbradder555 <bradder555@users.noreply.github.com>2017-09-15 14:14:06 +0800
committerLauris BH <lauris@nix.lv>2017-09-15 09:14:06 +0300
commitad24a3134d4851aa80e9a385fe97882f6d034020 (patch)
tree994e9ab889bfb1d32d2207b6dcf90a221f92aa23 /models/org.go
parent0f9e20b3d7a2c5f53cbf8d66e573b983288d06e0 (diff)
downloadgitea-ad24a3134d4851aa80e9a385fe97882f6d034020.tar.gz
gitea-ad24a3134d4851aa80e9a385fe97882f6d034020.zip
Fixes 500 error on dashboard when using MSSQL (#2504)
MSSQL rejects the query: SELECT "repository"."id" FROM "repository" INNER JOIN "team_repo" ON "team_repo".repo_id="repository".id AND "repository".is_mirror=1 WHERE ( ("repository".owner_id=2 AND "repository".is_private=0) OR team_repo.team_id IN (1) ) GROUP BY "repository".id ORDER BY updated_unix DESC when the order by term (updated_unix) is not included in the group by term.
Diffstat (limited to 'models/org.go')
-rw-r--r--models/org.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/models/org.go b/models/org.go
index fd81753931..31febe2543 100644
--- a/models/org.go
+++ b/models/org.go
@@ -680,7 +680,7 @@ func (env *accessibleReposEnv) MirrorRepoIDs() ([]int64, error) {
Table("repository").
Join("INNER", "team_repo", "`team_repo`.repo_id=`repository`.id AND `repository`.is_mirror=?", true).
Where(env.cond()).
- GroupBy("`repository`.id").
+ GroupBy("`repository`.id, `repository`.updated_unix").
OrderBy("updated_unix DESC").
Cols("`repository`.id").
Find(&repoIDs)