email 唯一

This commit is contained in:
2023-05-16 04:55:18 +08:00
parent 983447bfc2
commit f899e84b48
2 changed files with 2 additions and 2 deletions

View File

@@ -10,7 +10,7 @@ import (
type User struct {
ID int `json:"id" gorm:"primary_key"`
Name string `json:"name"`
Email string `json:"email"`
Email string `json:"email" gorm:"unique;not null"`
Password string `json:"-"`
Slat string `json:"-"`
Admin bool `json:"admin"`