📜  gorm 类型数据 - 任何代码示例

📅  最后修改于: 2022-03-11 15:00:44.262000             🧑  作者: Mango

代码示例1
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
}