diff options
author | a1012112796 <1012112796@qq.com> | 2020-11-29 03:30:46 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-11-28 21:30:46 +0200 |
commit | 9c26dc1f3a742280baff4e9578545bc822016764 (patch) | |
tree | ac997d23e59a658b387302ecd65e76a39d99b9e8 /models/migrations | |
parent | 7ed5bf8cbe06bf2cfc4980cf6e020dc46dd71a79 (diff) | |
download | gitea-9c26dc1f3a742280baff4e9578545bc822016764.tar.gz gitea-9c26dc1f3a742280baff4e9578545bc822016764.zip |
Add block on official review requests branch protection (#13705)
Signed-off-by: a1012112796 <1012112796@qq.com>
Co-authored-by: Lauris BH <lauris@nix.lv>
Diffstat (limited to 'models/migrations')
-rw-r--r-- | models/migrations/migrations.go | 2 | ||||
-rw-r--r-- | models/migrations/v160.go | 17 |
2 files changed, 19 insertions, 0 deletions
diff --git a/models/migrations/migrations.go b/models/migrations/migrations.go index 5a2646474c..6b13719b44 100644 --- a/models/migrations/migrations.go +++ b/models/migrations/migrations.go @@ -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 diff --git a/models/migrations/v160.go b/models/migrations/v160.go new file mode 100644 index 0000000000..e1a4b4821d --- /dev/null +++ b/models/migrations/v160.go @@ -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)) +} |