0
0
Fork 0
mirror of https://github.com/go-gitea/gitea synced 2024-11-01 03:39:28 +01:00
gitea/models/migrations/v231.go
Lunny Xiao f337c32e86
Add index for hook_task table (#21545)
Since `hook_id` and `uuid` will become a search condition column. It's
better to add some index for them.
2022-10-28 13:05:39 +02:00

19 lines
420 B
Go

// Copyright 2022 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 addIndexForHookTask(x *xorm.Engine) error {
type HookTask struct {
ID int64 `xorm:"pk autoincr"`
HookID int64 `xorm:"index"`
UUID string `xorm:"unique"`
}
return x.Sync(new(HookTask))
}