From a4a7dd066041cf3a047b39c6bf375720d36e3293 Mon Sep 17 00:00:00 2001 From: back2root Date: Wed, 18 Jul 2018 00:08:15 +0200 Subject: [PATCH] Fix column droping for MySQL that need a new session for the new transaction. --- models/migrations/v64.go | 5 +++++ models/migrations/v69.go | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/models/migrations/v64.go b/models/migrations/v64.go index 5958cd8f8259f..a18e39c1b0601 100644 --- a/models/migrations/v64.go +++ b/models/migrations/v64.go @@ -124,6 +124,11 @@ func addMultipleAssignees(x *xorm.Engine) error { if err := sess.Commit(); err != nil { return err } + + sess.Close() + sess = x.NewSession() + defer sess.Close() + if err := sess.Begin(); err != nil { return err } diff --git a/models/migrations/v69.go b/models/migrations/v69.go index 9a6e42e712ddf..f90109fffde17 100644 --- a/models/migrations/v69.go +++ b/models/migrations/v69.go @@ -77,6 +77,11 @@ func moveTeamUnitsToTeamUnitTable(x *xorm.Engine) error { if err := sess.Commit(); err != nil { return err } + + sess.Close() + sess = x.NewSession() + defer sess.Close() + if err := sess.Begin(); err != nil { return err }