From 57ea79d3cc2c64265641203802a03b476973e2f3 Mon Sep 17 00:00:00 2001 From: Lauris BH Date: Fri, 13 Jul 2018 18:20:40 +0300 Subject: [PATCH] Fix column droping for MSSQL that need new transaction for that (#4440) --- 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 67ce3a9196a70..5958cd8f8259f 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 8d964688aec13..9a6e42e712ddf 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 }