Skip to content

Commit 9b50743

Browse files
committed
extend comment treepath length
1 parent dca375a commit 9b50743

File tree

3 files changed

+17
-2
lines changed

3 files changed

+17
-2
lines changed

models/issues/comment.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -279,8 +279,8 @@ type Comment struct {
279279
DependentIssue *Issue `xorm:"-"`
280280

281281
CommitID int64
282-
Line int64 // - previous line / + proposed line
283-
TreePath string
282+
Line int64 // - previous line / + proposed line
283+
TreePath string `xorm:"VARCHAR(1024)"`
284284
Content string `xorm:"LONGTEXT"`
285285
ContentVersion int `xorm:"NOT NULL DEFAULT 0"`
286286
RenderedContent template.HTML `xorm:"-"`

models/migrations/migrations.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -393,6 +393,7 @@ func prepareMigrationTasks() []*migration {
393393

394394
// Gitea 1.24.0 ends at database version 321
395395
newMigration(321, "Use LONGTEXT for some columns and fix review_state.updated_files column", v1_25.UseLongTextInSomeColumnsAndFixBugs),
396+
newMigration(322, "Extend comment treepath length to 1024", v1_25.ExtendCommentTreePathLength),
396397
}
397398
return preparedMigrations
398399
}

models/migrations/v1_25/v322.go

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
// Copyright 2025 The Gitea Authors. All rights reserved.
2+
// SPDX-License-Identifier: MIT
3+
4+
package v1_25
5+
6+
import "xorm.io/xorm"
7+
8+
func ExtendCommentTreePathLength(x *xorm.Engine) error {
9+
type Comment struct {
10+
TreePath string `xorm:"VARCHAR(1024)"`
11+
}
12+
13+
return x.Sync(new(Comment))
14+
}

0 commit comments

Comments
 (0)