aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLunny Xiao2018-12-09 08:57:49 +0800
committerLauris BH2018-12-09 02:57:49 +0200
commit8237fd4a2d42b7fe39a74293fc43e59fa7d63995 (patch)
tree459d992c9ab92ad4c332367cd5fa31596791ee2c
parent8e4a0a978a30155e16d533275f071848e2527bfb (diff)
fix topic name length on database (#5493) (#5495)
-rw-r--r--models/migrations/v68.go2
-rw-r--r--models/topic.go2
2 files changed, 2 insertions, 2 deletions
diff --git a/models/migrations/v68.go b/models/migrations/v68.go
index e27b896c8..6b9d0caa6 100644
--- a/models/migrations/v68.go
+++ b/models/migrations/v68.go
@@ -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"`
diff --git a/models/topic.go b/models/topic.go
index 678795a3d..da1815be7 100644
--- a/models/topic.go
+++ b/models/topic.go
@@ -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"`