mirror of
https://github.com/go-gitea/gitea
synced 2025-07-22 18:28:37 +00:00
Add index for access_token (#21908)
The `token_last_eight` field has been used in `GetAccessTokenBySHA `:
This commit is contained in:
17
models/migrations/v1_19/v235.go
Normal file
17
models/migrations/v1_19/v235.go
Normal file
@@ -0,0 +1,17 @@
|
||||
// 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 v1_19 //nolint
|
||||
|
||||
import (
|
||||
"xorm.io/xorm"
|
||||
)
|
||||
|
||||
func AddIndexForAccessToken(x *xorm.Engine) error {
|
||||
type AccessToken struct {
|
||||
TokenLastEight string `xorm:"INDEX token_last_eight"`
|
||||
}
|
||||
|
||||
return x.Sync(new(AccessToken))
|
||||
}
|
Reference in New Issue
Block a user