Documentation ¶ Index ¶ func DBMigrate(db *gorm.DB) *gorm.DB type Employee func (e *Employee) Disable() func (e *Employee) Enable() Constants ¶ This section is empty. Variables ¶ This section is empty. Functions ¶ func DBMigrate ¶ func DBMigrate(db *gorm.DB) *gorm.DB DBMigrate将会创建表,若有必要,还会创建某些关系。 Types ¶ type Employee ¶ type Employee struct { gorm.Model Name string `gorm:"unique" json:"name"` City string `json:"city"` Age string `json:"age"` Status bool `json:"status"` } func (*Employee) Disable ¶ func (e *Employee) Disable() func (*Employee) Enable ¶ func (e *Employee) Enable() Source Files ¶ View all Source files model.go Click to show internal directories. Click to hide internal directories.