]> source.dussan.org Git - gitea.git/commitdiff
Issue with Migration rule v111 (#9449)
authorMarge Bouvier <7380756+MarcelHillmann@users.noreply.github.com>
Sat, 21 Dec 2019 10:12:39 +0000 (11:12 +0100)
committerAntoine GIRARD <sapk@users.noreply.github.com>
Sat, 21 Dec 2019 10:12:39 +0000 (11:12 +0100)
* 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 <sapk@users.noreply.github.com>
models/migrations/v111.go

index cf57e35dff3254e10f5708a3b8bd834571d924e3..30128abd04efa8fc42072658471cbe31f0e56968 100644 (file)
@@ -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
        }