mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2024-09-07 15:33:26 +00:00
fix migration 78 error mssql (#5791)
This commit is contained in:
parent
f631702299
commit
b80d6490f3
1 changed files with 2 additions and 3 deletions
|
@ -31,6 +31,8 @@ func renameRepoIsBareToIsEmpty(x *xorm.Engine) error {
|
||||||
var err error
|
var err error
|
||||||
if models.DbCfg.Type == core.POSTGRES || models.DbCfg.Type == core.SQLITE {
|
if models.DbCfg.Type == core.POSTGRES || models.DbCfg.Type == core.SQLITE {
|
||||||
_, err = sess.Exec("DROP INDEX IF EXISTS IDX_repository_is_bare")
|
_, 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 {
|
} else {
|
||||||
_, err = sess.Exec("DROP INDEX IDX_repository_is_bare ON repository")
|
_, err = sess.Exec("DROP INDEX IDX_repository_is_bare ON repository")
|
||||||
}
|
}
|
||||||
|
@ -42,9 +44,6 @@ func renameRepoIsBareToIsEmpty(x *xorm.Engine) error {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
// Then reset the values
|
|
||||||
sess = x.NewSession()
|
|
||||||
defer sess.Close()
|
|
||||||
if err := sess.Begin(); err != nil {
|
if err := sess.Begin(); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue