diff --git a/models/migrations/v111.go b/models/migrations/v111.go index cf57e35dff325..30128abd04efa 100644 --- a/models/migrations/v111.go +++ b/models/migrations/v111.go @@ -34,6 +34,9 @@ func addBranchProtectionCanPushAndEnableWhitelist(x *xorm.Engine) error { return err } + if _, err := sess.Exec("UPDATE `protected_branch` SET `enable_whitelist` = ? WHERE enable_whitelist IS NULL", false); err != nil { + return err + } if _, err := sess.Exec("UPDATE `protected_branch` SET `can_push` = `enable_whitelist`"); err != nil { return err }