File tree 3 files changed +21
-2
lines changed 3 files changed +21
-2
lines changed Original file line number Diff line number Diff line change @@ -14,8 +14,8 @@ import (
14
14
// IssueUser represents an issue-user relation.
15
15
type IssueUser struct {
16
16
ID int64 `xorm:"pk autoincr"`
17
- UID int64 `xorm:"INDEX"` // User ID.
18
- IssueID int64 `xorm:"INDEX"`
17
+ UID int64 `xorm:"INDEX INDEX(uidtoissue) "` // User ID.
18
+ IssueID int64 `xorm:"INDEX INDEX(uidtoissue) "`
19
19
IsRead bool
20
20
IsMentioned bool
21
21
}
Original file line number Diff line number Diff line change @@ -550,6 +550,8 @@ var migrations = []Migration{
550
550
NewMigration ("Add auth_token table" , v1_22 .CreateAuthTokenTable ),
551
551
// v282 -> v283
552
552
NewMigration ("Add Index to pull_auto_merge.doer_id" , v1_22 .AddIndexToPullAutoMergeDoerID ),
553
+ // v283 -> v284
554
+ NewMigration ("Add combined Index to issue_user.uid and issue_id" , v1_22 .AddCombinedIndexToIssueUser ),
553
555
}
554
556
555
557
// GetCurrentDBVersion returns the current db version
Original file line number Diff line number Diff line change
1
+ // Copyright 2023 The Gitea Authors. All rights reserved.
2
+ // SPDX-License-Identifier: MIT
3
+
4
+ package v1_22 //nolint
5
+
6
+ import (
7
+ "xorm.io/xorm"
8
+ )
9
+
10
+ func AddCombinedIndexToIssueUser (x * xorm.Engine ) error {
11
+ type IssueUser struct {
12
+ UID int64 `xorm:"INDEX(uidtoissue)"` // User ID.
13
+ IssueID int64 `xorm:"INDEX(uidtoissue)"`
14
+ }
15
+
16
+ return x .Sync (& IssueUser {})
17
+ }
You can’t perform that action at this time.
0 commit comments