From 30d512cfe73df4cb1dd10fa559a77e83d94cf617 Mon Sep 17 00:00:00 2001 From: dushixiang Date: Fri, 29 Jan 2021 20:04:04 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8Dusername=E5=94=AF=E4=B8=80?= =?UTF-8?q?=E7=B4=A2=E5=BC=95=E5=AF=BC=E8=87=B4=E5=88=9D=E5=A7=8B=E5=8C=96?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E5=BA=93=E5=A4=B1=E8=B4=A5=E7=9A=84=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= 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 a03cac1..fd7c1b1 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:"index:unique" json:"username"` + Username string `gorm:"uniqueIndex" json:"username"` Password string `json:"password"` Nickname string `json:"nickname"` TOTPSecret string `json:"-"`