mirror of
https://github.com/go-gitea/gitea.git
synced 2026-05-25 16:08:46 +09:00
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: wxiaoguang <2114189+wxiaoguang@users.noreply.github.com> Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
25 lines
581 B
Go
25 lines
581 B
Go
// Copyright 2026 The Gitea Authors. All rights reserved.
|
|
// SPDX-License-Identifier: MIT
|
|
|
|
package v1_27
|
|
|
|
import (
|
|
"code.gitea.io/gitea/models/db"
|
|
|
|
"xorm.io/xorm"
|
|
)
|
|
|
|
func AddBranchProtectionBypassAllowlist(x db.EngineMigration) error {
|
|
type ProtectedBranch struct {
|
|
EnableBypassAllowlist bool `xorm:"NOT NULL DEFAULT false"`
|
|
BypassAllowlistUserIDs []int64 `xorm:"JSON TEXT"`
|
|
BypassAllowlistTeamIDs []int64 `xorm:"JSON TEXT"`
|
|
}
|
|
|
|
_, err := x.SyncWithOptions(xorm.SyncOptions{
|
|
IgnoreConstrains: true,
|
|
IgnoreIndices: true,
|
|
}, new(ProtectedBranch))
|
|
return err
|
|
}
|