File tree Expand file tree Collapse file tree 6 files changed +7
-23
lines changed
Expand file tree Collapse file tree 6 files changed +7
-23
lines changed Original file line number Diff line number Diff line change @@ -42,7 +42,7 @@ type Issue struct {
4242 OriginalAuthor string
4343 OriginalAuthorID int64 `xorm:"index"`
4444 Title string `xorm:"name"`
45- Content string `xorm:"LONGTEXT "`
45+ Content string `xorm:"TEXT "`
4646 RenderedContent string `xorm:"-"`
4747 Labels []* Label `xorm:"-"`
4848 MilestoneID int64 `xorm:"INDEX"`
Original file line number Diff line number Diff line change @@ -228,12 +228,12 @@ type Comment struct {
228228 CommitID int64
229229 Line int64 // - previous line / + proposed line
230230 TreePath string
231- Content string `xorm:"LONGTEXT "`
231+ Content string `xorm:"TEXT "`
232232 RenderedContent string `xorm:"-"`
233233
234234 // Path represents the 4 lines of code cemented by this comment
235235 Patch string `xorm:"-"`
236- PatchQuoted string `xorm:"LONGTEXT patch"`
236+ PatchQuoted string `xorm:"TEXT patch"`
237237
238238 CreatedUnix timeutil.TimeStamp `xorm:"INDEX created"`
239239 UpdatedUnix timeutil.TimeStamp `xorm:"INDEX updated"`
Original file line number Diff line number Diff line change @@ -23,7 +23,7 @@ type ContentHistory struct {
2323 IssueID int64 `xorm:"INDEX"`
2424 CommentID int64 `xorm:"INDEX"`
2525 EditedUnix timeutil.TimeStamp `xorm:"INDEX"`
26- ContentText string `xorm:"LONGTEXT "`
26+ ContentText string `xorm:"TEXT "`
2727 IsFirstCreated bool
2828 IsDeleted bool
2929}
Original file line number Diff line number Diff line change @@ -335,7 +335,7 @@ var migrations = []Migration{
335335 // v190 -> v191
336336 NewMigration ("Add agit flow pull request support" , addAgitFlowPullRequest ),
337337 // v191 -> v192
338- NewMigration ("Alter issue/comment table TEXT fields to LONGTEXT" , alterIssueAndCommentTextFieldsToLongText ),
338+ NewMigration ("Alter issue/comment table TEXT fields to LONGTEXT (nop) " , alterIssueAndCommentTextFieldsToLongText ),
339339 // v192 -> v193
340340 NewMigration ("RecreateIssueResourceIndexTable to have a primary key instead of an unique index" , recreateIssueResourceIndexTable ),
341341 // v193 -> v194
Original file line number Diff line number Diff line change 55package migrations
66
77import (
8- "code.gitea.io/gitea/modules/setting"
9-
108 "xorm.io/xorm"
119)
1210
1311func alterIssueAndCommentTextFieldsToLongText (x * xorm.Engine ) error {
1412
15- sess := x .NewSession ()
16- defer sess .Close ()
17- if err := sess .Begin (); err != nil {
18- return err
19- }
20-
21- if setting .Database .UseMySQL {
22- if _ , err := sess .Exec ("ALTER TABLE `issue` CHANGE `content` `content` LONGTEXT" ); err != nil {
23- return err
24- }
25- if _ , err := sess .Exec ("ALTER TABLE `comment` CHANGE `content` `content` LONGTEXT, CHANGE `patch` `patch` LONGTEXT" ); err != nil {
26- return err
27- }
28- }
29- return sess .Commit ()
13+ return nil
3014}
Original file line number Diff line number Diff line change @@ -19,7 +19,7 @@ func addTableIssueContentHistory(x *xorm.Engine) error {
1919 IssueID int64 `xorm:"INDEX"`
2020 CommentID int64 `xorm:"INDEX"`
2121 EditedUnix timeutil.TimeStamp `xorm:"INDEX"`
22- ContentText string `xorm:"LONGTEXT "`
22+ ContentText string `xorm:"TEXT "`
2323 IsFirstCreated bool
2424 IsDeleted bool
2525 }
You can’t perform that action at this time.
0 commit comments