fix: unique entity

This commit is contained in:
ericprd
2025-03-01 21:27:28 +08:00
parent bdf6dd131e
commit eb1584f8c4
6 changed files with 13 additions and 10 deletions
+2 -2
View File
@@ -7,9 +7,9 @@ import (
type User struct {
ID string `gorm:"primaryKey" json:"id"`
SubscribeID string `gorm:"not null" json:"subscribe_id"`
Email string `gorm:"unique,not null" json:"email"`
Email string `gorm:"unique;not null" json:"email"`
Password string `gorm:"not null" json:"password"`
Phone string `gorm:"default:null" json:"phone"`
Phone string `gorm:"default:not null;unique" json:"phone"`
CreatedAt time.Time `gorm:"default:CURRENT_TIMESTAMP" json:"created_at"`
UpdatedAt time.Time `gorm:"default:CURRENT_TIMESTAMP" json:"updated_at"`