github.com/artisanhe/tools@v1.0.1-0.20210607022958-19a8fef2eb04/sqlx/presets/soft_delete.go (about) 1 package presets 2 3 import ( 4 "github.com/artisanhe/tools/courier/enumeration" 5 ) 6 7 type SoftDelete struct { 8 Enabled enumeration.Bool `db:"F_enabled" sql:"int(8) unsigned NOT NULL DEFAULT '1'" json:"-"` 9 } 10 11 func (e *SoftDelete) Enable() { 12 e.Enabled = enumeration.BOOL__TRUE 13 } 14 15 func (e *SoftDelete) Disable() { 16 e.Enabled = enumeration.BOOL__FALSE 17 }