From 3e191935c87f0a3e91082d642844b39dbab48283 Mon Sep 17 00:00:00 2001 From: Lauris BH Date: Fri, 20 Jul 2018 22:27:30 +0300 Subject: [PATCH] Fix column droping for MSSQL that need new transaction for that (#4440) (#4484) --- models/migrations/v64.go | 8 ++++++++ models/migrations/v69.go | 8 ++++++++ 2 files changed, 16 insertions(+) diff --git a/models/migrations/v64.go b/models/migrations/v64.go index 67ce3a919..5958cd8f8 100644 --- a/models/migrations/v64.go +++ b/models/migrations/v64.go @@ -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 } diff --git a/models/migrations/v69.go b/models/migrations/v69.go index 8d964688a..9a6e42e71 100644 --- a/models/migrations/v69.go +++ b/models/migrations/v69.go @@ -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 }