aboutsummaryrefslogtreecommitdiffstats
path: root/models/migrations/v74.go
blob: 66e958c7fa89a1f6af388b3b7f793f61eb9f7331 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
// Copyright 2018 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 "github.com/go-xorm/xorm"

func addApprovalWhitelistsToProtectedBranches(x *xorm.Engine) error {
	type ProtectedBranch struct {
		ApprovalsWhitelistUserIDs []int64 `xorm:"JSON TEXT"`
		ApprovalsWhitelistTeamIDs []int64 `xorm:"JSON TEXT"`
		RequiredApprovals         int64   `xorm:"NOT NULL DEFAULT 0"`
	}
	return x.Sync2(new(ProtectedBranch))
}