mirror of
https://github.com/go-gitea/gitea.git
synced 2026-10-09 04:30:16 +09:00
0a4078558e
backport #39579
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
|
|
}
|