aboutsummaryrefslogtreecommitdiffstats
path: root/models
diff options
context:
space:
mode:
authorLunny Xiao <xiaolunwen@gmail.com>2019-01-21 18:12:45 +0800
committerLauris BH <lauris@nix.lv>2019-01-21 12:12:45 +0200
commitb80d6490f31d2dde2e12aeb7a68236bae5f6809d (patch)
treecb41d6bc4c2bb12a4882ee0a0b5b3e0d2084ab07 /models
parentf63170229913b4ad32920391227ab774921272de (diff)
downloadgitea-b80d6490f31d2dde2e12aeb7a68236bae5f6809d.tar.gz
gitea-b80d6490f31d2dde2e12aeb7a68236bae5f6809d.zip
fix migration 78 error mssql (#5791)
Diffstat (limited to 'models')
-rw-r--r--models/migrations/v78.go5
1 files changed, 2 insertions, 3 deletions
diff --git a/models/migrations/v78.go b/models/migrations/v78.go
index c12d18581c..382fd9e795 100644
--- a/models/migrations/v78.go
+++ b/models/migrations/v78.go
@@ -31,6 +31,8 @@ func renameRepoIsBareToIsEmpty(x *xorm.Engine) error {
var err error
if models.DbCfg.Type == core.POSTGRES || models.DbCfg.Type == core.SQLITE {
_, err = sess.Exec("DROP INDEX IF EXISTS IDX_repository_is_bare")
+ } else if models.DbCfg.Type == core.MSSQL {
+ _, err = sess.Exec("DROP INDEX IF EXISTS IDX_repository_is_bare ON repository")
} else {
_, err = sess.Exec("DROP INDEX IDX_repository_is_bare ON repository")
}
@@ -42,9 +44,6 @@ func renameRepoIsBareToIsEmpty(x *xorm.Engine) error {
return err
}
- // Then reset the values
- sess = x.NewSession()
- defer sess.Close()
if err := sess.Begin(); err != nil {
return err
}