summaryrefslogtreecommitdiffstats
path: root/models
diff options
context:
space:
mode:
authorLauris BH <lauris@nix.lv>2018-07-13 18:20:40 +0300
committertechknowlogick <techknowlogick@users.noreply.github.com>2018-07-13 11:20:40 -0400
commite95417ea2c0d9b5e0be0c0f7bf82eabb40919c33 (patch)
tree45803088c081a1c6861a7e3c7bb26dc682daeda1 /models
parent659bc727bd12bf219d80d38d8b634bd578ddb84f (diff)
downloadgitea-e95417ea2c0d9b5e0be0c0f7bf82eabb40919c33.tar.gz
gitea-e95417ea2c0d9b5e0be0c0f7bf82eabb40919c33.zip
Fix column droping for MSSQL that need new transaction for that (#4440)
Diffstat (limited to 'models')
-rw-r--r--models/migrations/v64.go8
-rw-r--r--models/migrations/v69.go8
2 files changed, 16 insertions, 0 deletions
diff --git a/models/migrations/v64.go b/models/migrations/v64.go
index 67ce3a9196..5958cd8f82 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 8d964688ae..9a6e42e712 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
}