Skip to content

Commit

Permalink
Fix column droping for MSSQL that need new transaction for that (go-g…
Browse files Browse the repository at this point in the history
  • Loading branch information
lafriks authored and techknowlogick committed Jul 13, 2018
1 parent 659bc72 commit e95417e
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
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

0 comments on commit e95417e

Please sign in to comment.