From: Marge Bouvier <7380756+MarcelHillmann@users.noreply.github.com> Date: Sat, 21 Dec 2019 10:12:39 +0000 (+0100) Subject: Issue with Migration rule v111 (#9449) X-Git-Tag: v1.11.0-rc1~98 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=8149ed70405224250256757ba39e4d84674e5937;p=gitea.git Issue with Migration rule v111 (#9449) * Issue with Migration rule v111 I was facing some issues with migration rule v111 * Update v111.go Fix pgsql test cases Co-authored-by: Antoine GIRARD --- diff --git a/models/migrations/v111.go b/models/migrations/v111.go index cf57e35dff..30128abd04 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 }