mirror of
https://github.com/go-gitea/gitea.git
synced 2026-10-10 13:26:53 +00:00
b0d5a63e7a
* fix: #39571 * ref: https://github.com/go-gitea/gitea/pull/38938#pullrequestreview-4945228548 * fix the bug in `assignTeamPermissionUnits` which can result in wrong team access --------- Signed-off-by: wxiaoguang <wxiaoguang@gmail.com>
26 lines
562 B
Go
26 lines
562 B
Go
// Copyright 2026 The Gitea Authors. All rights reserved.
|
|
// SPDX-License-Identifier: MIT
|
|
|
|
package v29
|
|
|
|
import (
|
|
"context"
|
|
|
|
"gitea.dev/modelmigration/base"
|
|
|
|
"xorm.io/xorm"
|
|
)
|
|
|
|
// AddActionRunCommitSHAIndex indexes the runs lookup by commit, which the API `head_sha` filter uses.
|
|
func AddActionRunCommitSHAIndex(_ context.Context, x base.EngineMigration) error {
|
|
type ActionRun struct {
|
|
CommitSHA string `xorm:"index"`
|
|
}
|
|
|
|
_, err := x.SyncWithOptions(xorm.SyncOptions{
|
|
IgnoreDropIndices: true,
|
|
IgnoreConstrains: true,
|
|
}, new(ActionRun))
|
|
return err
|
|
}
|