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
@@ -6,8 +6,8 @@ import (
type Staff struct {
ID string `gorm:"primaryKey" json:"id"`
Username string `gorm:"default:null" json:"username"`
Email string `gorm:"unique,not null" json:"email"`
Username string `gorm:"default:null;unique" json:"username"`
Email string `gorm:"unique;not null" json:"email"`
Password string `gorm:"not null" json:"password"`
CreatedAt time.Time `gorm:"default:CURRENT_TIMESTAMP" json:"created_at"`
UpdatedAt time.Time `gorm:"default:CURRENT_TIMESTAMP" json:"updated_at"`