File tree Expand file tree Collapse file tree 3 files changed +19
-1
lines changed Expand file tree Collapse file tree 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 {
140140// used in template render.
141141type Action struct {
142142 ID int64 `xorm:"pk autoincr"`
143- UserID int64 // Receiver user id.
143+ UserID int64 `xorm:"INDEX"` // Receiver user id.
144144 OpType ActionType
145145 ActUserID int64 // Action user id.
146146 ActUser * user_model.User `xorm:"-"`
Original file line number Diff line number Diff line change @@ -538,6 +538,8 @@ var migrations = []Migration{
538538 NewMigration ("Add Index to issue_user.issue_id" , v1_21 .AddIndexToIssueUserIssueID ),
539539 // v278 -> v279
540540 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 ),
541543}
542544
543545// 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