Do some performance optimize for issues list and view issue/pull (#29515) (migration only)
Refs: https://codeberg.org/forgejo/forgejo/pulls/2679#issuecomment-1720941
This commit is contained in:
parent
d67e7ae25a
commit
b019ecce89
2 changed files with 16 additions and 0 deletions
|
@ -568,6 +568,8 @@ var migrations = []Migration{
|
||||||
NewMigration("Add default_wiki_branch to repository table", v1_22.AddDefaultWikiBranch),
|
NewMigration("Add default_wiki_branch to repository table", v1_22.AddDefaultWikiBranch),
|
||||||
// v290 -> v291
|
// v290 -> v291
|
||||||
NewMigration("Add PayloadVersion to HookTask", v1_22.AddPayloadVersionToHookTaskTable),
|
NewMigration("Add PayloadVersion to HookTask", v1_22.AddPayloadVersionToHookTaskTable),
|
||||||
|
// v291 -> v292
|
||||||
|
NewMigration("Add Index to attachment.comment_id", v1_22.AddCommentIDIndexofAttachment),
|
||||||
}
|
}
|
||||||
|
|
||||||
// GetCurrentDBVersion returns the current db version
|
// GetCurrentDBVersion returns the current db version
|
||||||
|
|
14
models/migrations/v1_22/v291.go
Normal file
14
models/migrations/v1_22/v291.go
Normal file
|
@ -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…
Reference in a new issue