fix: phone and email nullable.

This commit is contained in:
2026-02-03 15:52:26 +08:00
parent 85ec3cba4a
commit d7885c442f

View File

@ -8,8 +8,8 @@ import (
type User struct {
ID uint `gorm:"primaryKey" json:"id"`
Username string `gorm:"uniqueIndex;not null" json:"username"`
Email string `gorm:"uniqueIndex;" json:"email"`
Phone string `gorm:"uniqueIndex;" json:"phone"`
Email *string `gorm:"uniqueIndex;" json:"email"`
Phone *string `gorm:"uniqueIndex;" json:"phone"`
Password string `gorm:"not null" json:"-"`
CreatedAt int64 `json:"created_at"`
UpdatedAt int64 `json:"updated_at"`