Browse Source

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

for-closed-social
Lauris BH 6 years ago
committed by techknowlogick
parent
commit
e95417ea2c
2 changed files with 16 additions and 0 deletions
  1. +8
    -0
      models/migrations/v64.go
  2. +8
    -0
      models/migrations/v69.go

+ 8
- 0
models/migrations/v64.go View File

@ -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 { if err := dropTableColumns(sess, "issue", "assignee_id"); err != nil {
return err return err
} }

+ 8
- 0
models/migrations/v69.go View File

@ -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 { if err := dropTableColumns(sess, "team", "unit_types"); err != nil {
return err return err
} }

Loading…
Cancel
Save