mirror of https://github.com/gogits/gogs.git
Browse Source
If user creates a protect branch for the first time (which has ID=0), it generates invalid whitelist records with 'protect_branch_id=0'. This prevents future updates of protect branch whitelist. Migration: remove existing invalid protect branch whitelist records.pull/4353/head
Unknwon
8 years ago
6 changed files with 26 additions and 9 deletions
@ -0,0 +1,14 @@
|
||||
// Copyright 2017 The Gogs Authors. All rights reserved.
|
||||
// Use of this source code is governed by a MIT-style
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
package migrations |
||||
|
||||
import ( |
||||
"github.com/go-xorm/xorm" |
||||
) |
||||
|
||||
func removeInvalidProtectBranchWhitelist(x *xorm.Engine) error { |
||||
_, err := x.Exec("DELETE FROM protect_branch_whitelist WHERE protect_branch_id = 0") |
||||
return err |
||||
} |
Loading…
Reference in new issue