legalgo-BE-go/database/user_model.go

18 lines
594 B
Go
Raw Normal View History

2025-02-26 22:28:19 +08:00
package database
import (
"time"
)
type User struct {
ID string `gorm:"primaryKey" json:"id"`
2025-02-26 22:28:19 +08:00
SubscribeID string `gorm:"not null" json:"subscribe_id"`
2025-03-01 21:27:28 +08:00
Email string `gorm:"unique;not null" json:"email"`
2025-02-26 22:28:19 +08:00
Password string `gorm:"not null" json:"password"`
2025-03-01 21:27:28 +08:00
Phone string `gorm:"default:not null;unique" json:"phone"`
2025-02-26 22:28:19 +08:00
CreatedAt time.Time `gorm:"default:CURRENT_TIMESTAMP" json:"created_at"`
UpdatedAt time.Time `gorm:"default:CURRENT_TIMESTAMP" json:"updated_at"`
Subscribe Subscribe `gorm:"foreignKey:SubscribeID;constraint:OnDelete:CASCADE"`
2025-02-26 22:28:19 +08:00
}