From 53f5164ca59a7b4268569ca8882530a39747da98 Mon Sep 17 00:00:00 2001 From: Marge Bouvier <7380756+MarcelHillmann@users.noreply.github.com> Date: Fri, 20 Dec 2019 20:18:07 +0100 Subject: [PATCH 1/2] Issue with Migration rule v111 I was facing some issues with migration rule v111 --- models/migrations/v111.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/models/migrations/v111.go b/models/migrations/v111.go index cf57e35dff325..bb67f63a74ad1 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` = 0 WHERE enable_whitelist IS NULL"); err != nil { + return err + } if _, err := sess.Exec("UPDATE `protected_branch` SET `can_push` = `enable_whitelist`"); err != nil { return err } From 8499956a6acd3b616f097b8e84a68e5cb76a4780 Mon Sep 17 00:00:00 2001 From: Marge Bouvier <7380756+MarcelHillmann@users.noreply.github.com> Date: Fri, 20 Dec 2019 20:34:10 +0100 Subject: [PATCH 2/2] Update v111.go Fix pgsql test cases --- models/migrations/v111.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/models/migrations/v111.go b/models/migrations/v111.go index bb67f63a74ad1..30128abd04efa 100644 --- a/models/migrations/v111.go +++ b/models/migrations/v111.go @@ -34,7 +34,7 @@ func addBranchProtectionCanPushAndEnableWhitelist(x *xorm.Engine) error { return err } - if _, err := sess.Exec("UPDATE `protected_branch` SET `enable_whitelist` = 0 WHERE enable_whitelist IS NULL"); err != nil { + 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 {