aboutsummaryrefslogtreecommitdiffstats
path: root/models/test_fixtures.go
diff options
context:
space:
mode:
authorLunny Xiao <xiaolunwen@gmail.com>2020-03-22 23:12:55 +0800
committerGitHub <noreply@github.com>2020-03-22 11:12:55 -0400
commitc61b902538e8e4b2bb83136f190e044a6bbcdd9b (patch)
treebc08142f5ced69721ab14793b8dc62aa83314268 /models/test_fixtures.go
parentdcaa5643d70cd1be72e53e82a30d2bc6e5f8de92 (diff)
downloadgitea-c61b902538e8e4b2bb83136f190e044a6bbcdd9b.tar.gz
gitea-c61b902538e8e4b2bb83136f190e044a6bbcdd9b.zip
Upgrade xorm to v1.0.0 (#10646)
* Upgrade xorm to v1.0.0 * small nit * Fix tests * Update xorm * Update xorm * fix go.sum * fix test * Fix bug when dump * Fix bug * update xorm to latest * Fix migration test * update xorm to latest * Fix import order * Use xorm tag
Diffstat (limited to 'models/test_fixtures.go')
-rw-r--r--models/test_fixtures.go3
1 files changed, 2 insertions, 1 deletions
diff --git a/models/test_fixtures.go b/models/test_fixtures.go
index fe6a790b0d..6c160742bd 100644
--- a/models/test_fixtures.go
+++ b/models/test_fixtures.go
@@ -9,6 +9,7 @@ import (
"time"
"gopkg.in/testfixtures.v2"
+ "xorm.io/xorm/schemas"
)
var fixtures *testfixtures.Context
@@ -36,7 +37,7 @@ func LoadFixtures() error {
fmt.Printf("LoadFixtures failed after retries: %v\n", err)
}
// Now if we're running postgres we need to tell it to update the sequences
- if x.Dialect().DriverName() == "postgres" {
+ if x.Dialect().URI().DBType == schemas.POSTGRES {
results, err := x.QueryString(`SELECT 'SELECT SETVAL(' ||
quote_literal(quote_ident(PGT.schemaname) || '.' || quote_ident(S.relname)) ||
', COALESCE(MAX(' ||quote_ident(C.attname)|| '), 1) ) FROM ' ||