Skip to content

Fix column droping for MSSQL that need new transaction for that #4440

New issue

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

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

Already on GitHub? # to your account

Merged
merged 2 commits into from
Jul 13, 2018
Merged
Show file tree
Hide file tree
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
8 changes: 8 additions & 0 deletions models/migrations/v64.go
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,14 @@ func addMultipleAssignees(x *xorm.Engine) error {
}
}

// Commit and begin new transaction for dropping columns
if err := sess.Commit(); err != nil {
return err
}
if err := sess.Begin(); err != nil {
return err
}

if err := dropTableColumns(sess, "issue", "assignee_id"); err != nil {
return err
}
Expand Down
8 changes: 8 additions & 0 deletions models/migrations/v69.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,14 @@ func moveTeamUnitsToTeamUnitTable(x *xorm.Engine) error {
}
}

// Commit and begin new transaction for dropping columns
if err := sess.Commit(); err != nil {
return err
}
if err := sess.Begin(); err != nil {
return err
}

if err := dropTableColumns(sess, "team", "unit_types"); err != nil {
return err
}
Expand Down