Skip to content

Commit 483153e

Browse files
authored
Merge branch 'main' into setup-node-5
2 parents df590b5 + 2653ac9 commit 483153e

File tree

4 files changed

+32
-2
lines changed

4 files changed

+32
-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(4000)"` // SQLServer only supports up to 4000
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 tree_path length limit", v1_25.ExtendCommentTreePathLength),
396397
}
397398
return preparedMigrations
398399
}

models/migrations/v1_25/v322.go

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
// Copyright 2025 The Gitea Authors. All rights reserved.
2+
// SPDX-License-Identifier: MIT
3+
4+
package v1_25
5+
6+
import (
7+
"code.gitea.io/gitea/models/migrations/base"
8+
9+
"xorm.io/xorm"
10+
"xorm.io/xorm/schemas"
11+
)
12+
13+
func ExtendCommentTreePathLength(x *xorm.Engine) error {
14+
dbType := x.Dialect().URI().DBType
15+
if dbType == schemas.SQLITE { // For SQLITE, varchar or char will always be represented as TEXT
16+
return nil
17+
}
18+
19+
return base.ModifyColumn(x, "comment", &schemas.Column{
20+
Name: "tree_path",
21+
SQLType: schemas.SQLType{
22+
Name: "VARCHAR",
23+
},
24+
Length: 4000,
25+
Nullable: true, // To keep compatible as nullable
26+
DefaultIsEmpty: true,
27+
})
28+
}

web_src/css/user.css

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,7 @@
120120
flex-wrap: wrap;
121121
gap: 0.5em;
122122
padding: 0.5em 1em;
123+
overflow-wrap: anywhere;
123124
}
124125

125126
.notifications-item:hover {

0 commit comments

Comments
 (0)