Skip to content

Commit 8237fd4

Browse files
lunnylafriks
authored andcommitted
fix topic name length on database (#5493) (#5495)
1 parent 8e4a0a9 commit 8237fd4

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

models/migrations/v68.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ func reformatAndRemoveIncorrectTopics(x *xorm.Engine) (err error) {
2525

2626
type Topic struct {
2727
ID int64
28-
Name string `xorm:"UNIQUE"`
28+
Name string `xorm:"UNIQUE VARCHAR(25)"`
2929
RepoCount int
3030
CreatedUnix int64 `xorm:"INDEX created"`
3131
UpdatedUnix int64 `xorm:"INDEX updated"`

models/topic.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ var topicPattern = regexp.MustCompile(`^[a-z0-9][a-z0-9-]*$`)
2626
// Topic represents a topic of repositories
2727
type Topic struct {
2828
ID int64
29-
Name string `xorm:"UNIQUE"`
29+
Name string `xorm:"UNIQUE VARCHAR(25)"`
3030
RepoCount int
3131
CreatedUnix util.TimeStamp `xorm:"INDEX created"`
3232
UpdatedUnix util.TimeStamp `xorm:"INDEX updated"`

0 commit comments

Comments
 (0)