From c2b8f8629dfc88a4fcd031700c373d69fb143941 Mon Sep 17 00:00:00 2001 From: dushixiang Date: Sat, 30 Jan 2021 00:25:46 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E7=94=A8=E6=88=B7username?= =?UTF-8?q?=E5=AD=97=E6=AE=B5=E4=B8=BA=E6=99=AE=E9=80=9A=E7=B4=A2=E5=BC=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pkg/model/user.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/model/user.go b/pkg/model/user.go index fd7c1b1..de3de6e 100644 --- a/pkg/model/user.go +++ b/pkg/model/user.go @@ -13,7 +13,7 @@ const ( type User struct { ID string `gorm:"primary_key" json:"id"` - Username string `gorm:"uniqueIndex" json:"username"` + Username string `gorm:"index" json:"username"` Password string `json:"password"` Nickname string `json:"nickname"` TOTPSecret string `json:"-"`