Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix migration 78 error mssql #5791

Merged
merged 1 commit into from
Jan 21, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions models/migrations/v78.go
Original file line number Diff line number Diff line change
Expand Up @@ -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")
}
Expand All @@ -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
}
Expand Down