···568568 NewMigration("Add default_wiki_branch to repository table", v1_22.AddDefaultWikiBranch),
569569 // v290 -> v291
570570 NewMigration("Add PayloadVersion to HookTask", v1_22.AddPayloadVersionToHookTaskTable),
571571+ // v291 -> v292
572572+ NewMigration("Add Index to attachment.comment_id", v1_22.AddCommentIDIndexofAttachment),
571573}
572574573575// GetCurrentDBVersion returns the current db version
+14
models/migrations/v1_22/v291.go
···11+// Copyright 2024 The Gitea Authors. All rights reserved.
22+// SPDX-License-Identifier: MIT
33+44+package v1_22 //nolint
55+66+import "xorm.io/xorm"
77+88+func AddCommentIDIndexofAttachment(x *xorm.Engine) error {
99+ type Attachment struct {
1010+ CommentID int64 `xorm:"INDEX"`
1111+ }
1212+1313+ return x.Sync(&Attachment{})
1414+}