Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Do some performance optimize for issues list and view issue/pull #29515

Merged
merged 10 commits into from
Mar 12, 2024
Prev Previous commit
Next Next commit
Merge branch 'main' into lunny/optimaze_view_issue
  • Loading branch information
lunny committed Mar 8, 2024
commit 6369717201be17e97f8c606b12422db1d948386c
2 changes: 2 additions & 0 deletions models/migrations/migrations.go
Original file line number Diff line number Diff line change
Expand Up @@ -565,6 +565,8 @@ var migrations = []Migration{
// v289 -> v290
NewMigration("Add default_wiki_branch to repository table", v1_22.AddDefaultWikiBranch),
// v290 -> v291
NewMigration("Add PayloadVersion to HookTask", v1_22.AddPayloadVersionToHookTaskTable),
// v291 -> v292
NewMigration("Add Index to attachment.comment_id", v1_22.AddCommentIDIndexofAttachment),
}

Expand Down
15 changes: 9 additions & 6 deletions models/migrations/v1_22/v290.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,15 @@

package v1_22 //nolint

import "xorm.io/xorm"
import (
"xorm.io/xorm"
)

func AddCommentIDIndexofAttachment(x *xorm.Engine) error {
type Attachment struct {
CommentID int64 `xorm:"INDEX"`
}
type HookTask struct {
PayloadVersion int `xorm:"DEFAULT 1"`
}

return x.Sync(&Attachment{})
func AddPayloadVersionToHookTaskTable(x *xorm.Engine) error {
// create missing column
return x.Sync(new(HookTask))
}
14 changes: 14 additions & 0 deletions models/migrations/v1_22/v291.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
// Copyright 2024 The Gitea Authors. All rights reserved.
// SPDX-License-Identifier: MIT

package v1_22 //nolint

import "xorm.io/xorm"

func AddCommentIDIndexofAttachment(x *xorm.Engine) error {
type Attachment struct {
CommentID int64 `xorm:"INDEX"`
}

return x.Sync(&Attachment{})
}
Loading
You are viewing a condensed version of this merge commit. You can view the full changes here.