]> source.dussan.org Git - gitea.git/commitdiff
fix topic name length on database (#5493) (#5495)
authorLunny Xiao <xiaolunwen@gmail.com>
Sun, 9 Dec 2018 00:57:49 +0000 (08:57 +0800)
committerLauris BH <lauris@nix.lv>
Sun, 9 Dec 2018 00:57:49 +0000 (02:57 +0200)
models/migrations/v68.go
models/topic.go

index e27b896c82df0edac73cbe2a975b1902e7877145..6b9d0caa65ea3e7159b66d84906a7e0b88401ba3 100644 (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"`
index 678795a3dba9811cd2b2f485cdfc3ac25550f432..da1815be76e69e0cdf77b510d9e070a0d5b1be9f 100644 (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"`