How to tell gorm to save missing time.Time fields as NULL and not '0000-00-00'

后端 未结 0 1990
生来不讨喜
生来不讨喜 2021-01-29 16:13

I have this custom type for users:

type User struct {
    UserID    uint64 `gorm:"primaryKey"`
    CreatedAt time.Time
    UpdatedAt time.Time
    LastL         


        
相关标签:
回答
  • 消灭零回复
提交回复
热议问题