From a22836a6446de1bd98627afb8d9e4a37fc31e1b0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ferdinand=20M=C3=BCtsch?= Date: Wed, 14 Apr 2021 00:17:02 +0200 Subject: [PATCH] fix: remove uniqueness constraint for email --- models/user.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/models/user.go b/models/user.go index 988634f..01a7aeb 100644 --- a/models/user.go +++ b/models/user.go @@ -9,7 +9,7 @@ func init() { type User struct { ID string `json:"id" gorm:"primary_key"` ApiKey string `json:"api_key" gorm:"unique"` - Email string `json:"email" gorm:"uniqueIndex:idx_user_email; size:255"` + Email string `json:"email" gorm:"index:idx_user_email; size:255"` Password string `json:"-"` CreatedAt CustomTime `gorm:"type:timestamp; default:CURRENT_TIMESTAMP" swaggertype:"string" format:"date" example:"2006-01-02 15:04:05.000"` LastLoggedInAt CustomTime `gorm:"type:timestamp; default:CURRENT_TIMESTAMP" swaggertype:"string" format:"date" example:"2006-01-02 15:04:05.000"`