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 {
66
66
Token string `xorm:"-"`
67
67
TokenHash string `xorm:"UNIQUE"` // sha256 of token
68
68
TokenSalt string
69
- TokenLastEight string `xorm:"token_last_eight"`
69
+ TokenLastEight string `xorm:"INDEX token_last_eight"`
70
70
71
71
CreatedUnix timeutil.TimeStamp `xorm:"INDEX created"`
72
72
UpdatedUnix timeutil.TimeStamp `xorm:"INDEX updated"`
Original file line number Diff line number Diff line change @@ -441,6 +441,8 @@ var migrations = []Migration{
441
441
NewMigration ("Add header_authorization_encrypted column to webhook table" , v1_19 .AddHeaderAuthorizationEncryptedColWebhook ),
442
442
// v234 -> v235
443
443
NewMigration ("Add package cleanup rule table" , v1_19 .CreatePackageCleanupRuleTable ),
444
+ // v235 -> v236
445
+ NewMigration ("Add index for access_token" , v1_19 .AddIndexForAccessToken ),
444
446
}
445
447
446
448
// 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