diff --git a/model/common.go b/model/common.go index fc51e7c..3341e54 100644 --- a/model/common.go +++ b/model/common.go @@ -2,6 +2,8 @@ package model import ( "time" + + "gorm.io/gorm" ) const CtxKeyAuthorizedUser = "ckau" @@ -9,10 +11,10 @@ const CtxKeyViewPasswordVerified = "ckvpv" const CacheKeyOauth2State = "p:a:state" type Common struct { - ID uint64 `gorm:"primaryKey"` - CreatedAt time.Time `sql:"index"` - UpdatedAt time.Time - DeletedAt *time.Time `sql:"index"` + ID uint64 `gorm:"primaryKey"` + CreatedAt time.Time `gorm:"index;<-:create"` + UpdatedAt time.Time `gorm:"autoUpdateTime"` + DeletedAt gorm.DeletedAt `gorm:"index"` } type Response struct {