File tree Expand file tree Collapse file tree 3 files changed +21
-0
lines changed Expand file tree Collapse file tree 3 files changed +21
-0
lines changed Original file line number Diff line number Diff line change @@ -26,6 +26,7 @@ type ProtectedBranch struct {
26
26
ID int64 `xorm:"pk autoincr"`
27
27
RepoID int64 `xorm:"UNIQUE(s)"`
28
28
BranchName string `xorm:"UNIQUE(s)"`
29
+ CanPush bool `xorm:"NOT NULL DEFAULT false"`
29
30
EnableWhitelist bool
30
31
WhitelistUserIDs []int64 `xorm:"JSON TEXT"`
31
32
WhitelistTeamIDs []int64 `xorm:"JSON TEXT"`
Original file line number Diff line number Diff line change @@ -134,6 +134,8 @@ var migrations = []Migration{
134
134
NewMigration ("add default value to user prohibit_login" , addDefaultValueToUserProhibitLogin ),
135
135
// v42 -> v43
136
136
NewMigration ("add tags to releases and sync existing repositories" , releaseAddColumnIsTagAndSyncTags ),
137
+ // v43 -> v44
138
+ NewMigration ("fix protected branch can push value to false" , fixProtectedBranchCanPushValue ),
137
139
}
138
140
139
141
// Migrate database to current version
Original file line number Diff line number Diff line change
1
+ // Copyright 2017 The Gitea Authors. All rights reserved.
2
+ // Use of this source code is governed by a MIT-style
3
+ // license that can be found in the LICENSE file.
4
+
5
+ package migrations
6
+
7
+ import (
8
+ "code.gitea.io/gitea/models"
9
+
10
+ "github.com/go-xorm/xorm"
11
+ )
12
+
13
+ func fixProtectedBranchCanPushValue (x * xorm.Engine ) error {
14
+ _ , err := x .Cols ("can_push" ).Update (& models.ProtectedBranch {
15
+ CanPush : false ,
16
+ })
17
+ return err
18
+ }
You can’t perform that action at this time.
0 commit comments