From 7e229a1b834c5a510664c36a52d342f0dc61e2fe Mon Sep 17 00:00:00 2001 From: kolaente Date: Wed, 14 Jul 2021 12:43:28 +0200 Subject: [PATCH] Save user tokens as text and not varchar --- pkg/migration/20210711173657.go | 2 +- pkg/user/token.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/migration/20210711173657.go b/pkg/migration/20210711173657.go index 15e04b795ea..8391996099e 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 8ffd8dc1610..0a999f0e1b9 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"` }