diff --git a/pkg/migration/20210711173657.go b/pkg/migration/20210711173657.go index 15e04b79..83919960 100644 --- a/pkg/migration/20210711173657.go +++ b/pkg/migration/20210711173657.go @@ -36,7 +36,7 @@ func (u user20210711173657) TableName() string { type userTokens20210711173657 struct { ID int64 `xorm:"bigint autoincr not null unique pk"` UserID int64 `xorm:"not null"` - Token string `xorm:"not null"` + Token string `xorm:"TEXT not null index"` Kind int `xorm:"not null"` Created time.Time `xorm:"created not null"` } diff --git a/pkg/user/token.go b/pkg/user/token.go index 8ffd8dc1..0a999f0e 100644 --- a/pkg/user/token.go +++ b/pkg/user/token.go @@ -41,7 +41,7 @@ const ( type Token struct { ID int64 `xorm:"bigint autoincr not null unique pk"` UserID int64 `xorm:"not null"` - Token string `xorm:"not null"` + Token string `xorm:"TEXT not null index"` Kind TokenKind `xorm:"not null"` Created time.Time `xorm:"created not null"` }