From 8149ed70405224250256757ba39e4d84674e5937 Mon Sep 17 00:00:00 2001 From: Marge Bouvier <7380756+MarcelHillmann@users.noreply.github.com> Date: Sat, 21 Dec 2019 11:12:39 +0100 Subject: [PATCH] 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 --- models/migrations/v111.go | 3 +++ 1 file changed, 3 insertions(+) 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 }