Browse Source

fix topic name length on database (#5493)

tags/v1.7.0-dev
Lunny Xiao Lauris BH 6 years ago
parent
commit
b35cee039b
2 changed files with 2 additions and 2 deletions
  1. +1
    -1
      models/migrations/v68.go
  2. +1
    -1
      models/topic.go

+ 1
- 1
models/migrations/v68.go View File

@@ -25,7 +25,7 @@ func reformatAndRemoveIncorrectTopics(x *xorm.Engine) (err error) {

type Topic struct {
ID int64
Name string `xorm:"UNIQUE"`
Name string `xorm:"UNIQUE VARCHAR(25)"`
RepoCount int
CreatedUnix int64 `xorm:"INDEX created"`
UpdatedUnix int64 `xorm:"INDEX updated"`


+ 1
- 1
models/topic.go View File

@@ -26,7 +26,7 @@ var topicPattern = regexp.MustCompile(`^[a-z0-9][a-z0-9-]*$`)
// Topic represents a topic of repositories
type Topic struct {
ID int64
Name string `xorm:"UNIQUE"`
Name string `xorm:"UNIQUE VARCHAR(25)"`
RepoCount int
CreatedUnix util.TimeStamp `xorm:"INDEX created"`
UpdatedUnix util.TimeStamp `xorm:"INDEX updated"`


Loading…
Cancel
Save