我正在使用 GORM,并且正在映射旧表。
默认情况下 GORM 有这个结构:
type Model struct {
ID uint `gorm:"primarykey"`
CreatedAt time.Time
UpdatedAt time.Time
DeletedAt DeletedAt `gorm:"index"`
}
Run Code Online (Sandbox Code Playgroud)
我在旧表中没有 CreatedAt UpdatedAt DeletedAt 字段,我需要避免或禁用此默认结构。
我找不到避免这些专栏的方法。