legalgo-BE-go/database/user_model.go

19 lines
683 B
Go
Raw Permalink Normal View History

2025-02-26 22:28:19 +08:00
package database
import (
"time"
)
type User struct {
2025-03-02 04:36:17 +08:00
ID string `gorm:"primaryKey;not null" 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"`
DeletedAt time.Time `gorm:"default:null" json:"deleted_at"`
Subscribe Subscribe `gorm:"foreignKey:SubscribeID;constraint:OnDelete:CASCADE" json:"subscribe"`
2025-02-26 22:28:19 +08:00
}