Skip to content

Commit f3c42bc

Browse files
committed
Use 4096
1 parent 9b50743 commit f3c42bc

File tree

2 files changed

+16
-7
lines changed

2 files changed

+16
-7
lines changed

models/issues/comment.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -280,7 +280,7 @@ type Comment struct {
280280

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

models/migrations/v1_25/v322.go

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,21 @@
33

44
package v1_25
55

6-
import "xorm.io/xorm"
6+
import (
7+
"code.gitea.io/gitea/models/migrations/base"
78

8-
func ExtendCommentTreePathLength(x *xorm.Engine) error {
9-
type Comment struct {
10-
TreePath string `xorm:"VARCHAR(1024)"`
11-
}
9+
"xorm.io/xorm"
10+
"xorm.io/xorm/schemas"
11+
)
1212

13-
return x.Sync(new(Comment))
13+
func ExtendCommentTreePathLength(x *xorm.Engine) error {
14+
return base.ModifyColumn(x, "comment", &schemas.Column{
15+
Name: "tree_path",
16+
SQLType: schemas.SQLType{
17+
Name: "VARCHAR",
18+
},
19+
Length: 4096,
20+
Nullable: true, // To keep compatible as nullable
21+
DefaultIsEmpty: true,
22+
})
1423
}

0 commit comments

Comments
 (0)