File tree Expand file tree Collapse file tree 3 files changed +20
-1
lines changed Expand file tree Collapse file tree 3 files changed +20
-1
lines changed Original file line number Diff line number Diff line change @@ -66,7 +66,7 @@ type AccessToken struct {
6666 Token string `xorm:"-"`
6767 TokenHash string `xorm:"UNIQUE"` // sha256 of token
6868 TokenSalt string
69- TokenLastEight string `xorm:"token_last_eight"`
69+ TokenLastEight string `xorm:"INDEX token_last_eight"`
7070
7171 CreatedUnix timeutil.TimeStamp `xorm:"INDEX created"`
7272 UpdatedUnix timeutil.TimeStamp `xorm:"INDEX updated"`
Original file line number Diff line number Diff line change @@ -441,6 +441,8 @@ var migrations = []Migration{
441441 NewMigration ("Add header_authorization_encrypted column to webhook table" , v1_19 .AddHeaderAuthorizationEncryptedColWebhook ),
442442 // v234 -> v235
443443 NewMigration ("Add package cleanup rule table" , v1_19 .CreatePackageCleanupRuleTable ),
444+ // v235 -> v236
445+ NewMigration ("Add index for access_token" , v1_19 .AddIndexForAccessToken ),
444446}
445447
446448// GetCurrentDBVersion returns the current db version
Original file line number Diff line number Diff line change 1+ // Copyright 2022 The Gitea Authors. All rights reserved.
2+ // Use of this source code is governed by a MIT-style
3+ // license that can be found in the LICENSE file.
4+
5+ package v1_19 //nolint
6+
7+ import (
8+ "xorm.io/xorm"
9+ )
10+
11+ func AddIndexForAccessToken (x * xorm.Engine ) error {
12+ type AccessToken struct {
13+ TokenLastEight string `xorm:"INDEX token_last_eight"`
14+ }
15+
16+ return x .Sync (new (AccessToken ))
17+ }
You can’t perform that action at this time.
0 commit comments