File tree 3 files changed +19
-1
lines changed 3 files changed +19
-1
lines changed Original file line number Diff line number Diff line change @@ -140,7 +140,7 @@ func (at ActionType) InActions(actions ...string) bool {
140
140
// used in template render.
141
141
type Action struct {
142
142
ID int64 `xorm:"pk autoincr"`
143
- UserID int64 // Receiver user id.
143
+ UserID int64 `xorm:"INDEX"` // Receiver user id.
144
144
OpType ActionType
145
145
ActUserID int64 // Action user id.
146
146
ActUser * user_model.User `xorm:"-"`
Original file line number Diff line number Diff line change @@ -538,6 +538,8 @@ var migrations = []Migration{
538
538
NewMigration ("Add Index to issue_user.issue_id" , v1_21 .AddIndexToIssueUserIssueID ),
539
539
// v278 -> v279
540
540
NewMigration ("Add Index to comment.dependent_issue_id" , v1_21 .AddIndexToCommentDependentIssueID ),
541
+ // v279 -> v280
542
+ NewMigration ("Add Index to action.user_id" , v1_21 .AddIndexToActionUserID ),
541
543
}
542
544
543
545
// 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_21 //nolint
5
+
6
+ import (
7
+ "xorm.io/xorm"
8
+ )
9
+
10
+ func AddIndexToActionUserID (x * xorm.Engine ) error {
11
+ type Action struct {
12
+ UserID int64 `xorm:"INDEX"`
13
+ }
14
+
15
+ return x .Sync (new (Action ))
16
+ }
You can’t perform that action at this time.
0 commit comments