Answers for "gorm boolean struct"

0

gorm boolean struct

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
}
Posted by: Guest on April-15-2021

Browse Popular Code Answers by Language