summaryrefslogtreecommitdiffstats
path: root/models/migrations
diff options
context:
space:
mode:
Diffstat (limited to 'models/migrations')
-rw-r--r--models/migrations/migrations.go2
-rw-r--r--models/migrations/v43.go18
2 files changed, 20 insertions, 0 deletions
diff --git a/models/migrations/migrations.go b/models/migrations/migrations.go
index d302b2c075..95b8e0774f 100644
--- a/models/migrations/migrations.go
+++ b/models/migrations/migrations.go
@@ -134,6 +134,8 @@ var migrations = []Migration{
NewMigration("add default value to user prohibit_login", addDefaultValueToUserProhibitLogin),
// v42 -> v43
NewMigration("add tags to releases and sync existing repositories", releaseAddColumnIsTagAndSyncTags),
+ // v43 -> v44
+ NewMigration("fix protected branch can push value to false", fixProtectedBranchCanPushValue),
}
// Migrate database to current version
diff --git a/models/migrations/v43.go b/models/migrations/v43.go
new file mode 100644
index 0000000000..b6351fa831
--- /dev/null
+++ b/models/migrations/v43.go
@@ -0,0 +1,18 @@
+// Copyright 2017 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 (
+ "code.gitea.io/gitea/models"
+
+ "github.com/go-xorm/xorm"
+)
+
+func fixProtectedBranchCanPushValue(x *xorm.Engine) error {
+ _, err := x.Cols("can_push").Update(&models.ProtectedBranch{
+ CanPush: false,
+ })
+ return err
+}