From c52d48aae46af879fdfcfd94d03b7072878b5441 Mon Sep 17 00:00:00 2001 From: 6543 <6543@obermui.de> Date: Fri, 17 Apr 2020 03:00:36 +0200 Subject: Prevent merge of outdated PRs on protected branches (#11012) * Block PR on Outdated Branch * finalize * cleanup * fix typo and sentences thanks @guillep2k Co-Authored-By: guillep2k <18600385+guillep2k@users.noreply.github.com> Co-authored-by: guillep2k <18600385+guillep2k@users.noreply.github.com> Co-authored-by: Lauris BH --- models/migrations/v137.go | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 models/migrations/v137.go (limited to 'models/migrations/v137.go') diff --git a/models/migrations/v137.go b/models/migrations/v137.go new file mode 100644 index 0000000000..f175cf8a80 --- /dev/null +++ b/models/migrations/v137.go @@ -0,0 +1,16 @@ +// 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 addBlockOnOutdatedBranch(x *xorm.Engine) error { + type ProtectedBranch struct { + BlockOnOutdatedBranch bool `xorm:"NOT NULL DEFAULT false"` + } + return x.Sync2(new(ProtectedBranch)) +} -- cgit v1.2.3