summaryrefslogtreecommitdiffstats
path: root/models/migrations
diff options
context:
space:
mode:
authorLunny Xiao <xiaolunwen@gmail.com>2019-10-18 19:13:31 +0800
committerGitHub <noreply@github.com>2019-10-18 19:13:31 +0800
commit945f121262ef5a393d9530b62a82b2c141bbe21c (patch)
tree13d4d91da9a75295ee3455ff183a61c4d3fbb3ad /models/migrations
parentfecd8f949dedac0751db99dec590ff12ae56818d (diff)
downloadgitea-945f121262ef5a393d9530b62a82b2c141bbe21c.tar.gz
gitea-945f121262ef5a393d9530b62a82b2c141bbe21c.zip
Fix bug on pull requests when transfer head repository (#8564)
* fix bug on pull requests when transfer head repository * add migration and fix lint * fix tests and add a cache check on LoadBaseRepo
Diffstat (limited to 'models/migrations')
-rw-r--r--models/migrations/migrations.go2
-rw-r--r--models/migrations/v102.go15
2 files changed, 17 insertions, 0 deletions
diff --git a/models/migrations/migrations.go b/models/migrations/migrations.go
index 19b1095cd3..8064eccfc1 100644
--- a/models/migrations/migrations.go
+++ b/models/migrations/migrations.go
@@ -258,6 +258,8 @@ var migrations = []Migration{
NewMigration("update migration repositories' service type", updateMigrationServiceTypes),
// v101 -> v102
NewMigration("change length of some external login users columns", changeSomeColumnsLengthOfExternalLoginUser),
+ // v102 -> v103
+ NewMigration("update migration repositories' service type", dropColumnHeadUserNameOnPullRequest),
}
// Migrate database to current version
diff --git a/models/migrations/v102.go b/models/migrations/v102.go
new file mode 100644
index 0000000000..74e8574ec3
--- /dev/null
+++ b/models/migrations/v102.go
@@ -0,0 +1,15 @@
+// Copyright 2019 The Gitea Authors. All rights reserved.
+// Use of this source code is governed by a MIT-style
+// license that can be found in the LICENSE file.
+
+package migrations
+
+import (
+ "xorm.io/xorm"
+)
+
+func dropColumnHeadUserNameOnPullRequest(x *xorm.Engine) error {
+ sess := x.NewSession()
+ defer sess.Close()
+ return dropTableColumns(sess, "pull_request", "head_user_name")
+}