mirror of
https://github.com/go-gitea/gitea
synced 2025-07-22 18:28:37 +00:00
Add block on official review requests branch protection (#13705)
Signed-off-by: a1012112796 <1012112796@qq.com> Co-authored-by: Lauris BH <lauris@nix.lv>
This commit is contained in:
@@ -254,6 +254,8 @@ var migrations = []Migration{
|
||||
NewMigration("code comment replies should have the commitID of the review they are replying to", updateCodeCommentReplies),
|
||||
// v159 -> v160
|
||||
NewMigration("update reactions constraint", updateReactionConstraint),
|
||||
// v160 -> v161
|
||||
NewMigration("Add block on official review requests branch protection", addBlockOnOfficialReviewRequests),
|
||||
}
|
||||
|
||||
// GetCurrentDBVersion returns the current db version
|
||||
|
17
models/migrations/v160.go
Normal file
17
models/migrations/v160.go
Normal file
@@ -0,0 +1,17 @@
|
||||
// Copyright 2020 The Gitea 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 (
|
||||
"xorm.io/xorm"
|
||||
)
|
||||
|
||||
func addBlockOnOfficialReviewRequests(x *xorm.Engine) error {
|
||||
type ProtectedBranch struct {
|
||||
BlockOnOfficialReviewRequests bool `xorm:"NOT NULL DEFAULT false"`
|
||||
}
|
||||
|
||||
return x.Sync2(new(ProtectedBranch))
|
||||
}
|
Reference in New Issue
Block a user