📅  最后修改于: 2022-03-11 14:58:21.377000             🧑  作者: Mango
type data definition for struct using gorm same with your provider dbms use, example me using postgres
type EntityUsers struct {
ID uint `gorm:"type:bigserial;primaryKey;autoIncrement"`
Fullname string `gorm:"type:varchar(255);unique;not null"`
Email string `gorm:"type:varchar(255);unique;not null"`
Password string `gorm:"type:varchar(255);not null"`
Active bool `gorm:"type:bool;default:false"`
CreatedAt time.Time
UpdatedAt time.Time
}