We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ccff571 commit 2db424cCopy full SHA for 2db424c
models/migrations/v43.go
@@ -5,13 +5,21 @@
5
package migrations
6
7
import (
8
- "code.gitea.io/gitea/models"
+ "fmt"
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{
+ type ProtectedBranch struct {
15
+ CanPush bool `xorm:"NOT NULL DEFAULT false"`
16
+ }
17
+
18
+ if err := x.Sync2(new(ProtectedBranch)); err != nil {
19
+ return fmt.Errorf("Sync2: %v", err)
20
21
22
+ _, err := x.Cols("can_push").Update(&ProtectedBranch{
23
CanPush: false,
24
})
25
return err
0 commit comments