feat: set created_at and updated_at to timestamp (#1659)
Signed-off-by: Gaius <gaius.qi@gmail.com>
This commit is contained in:
parent
42e5e2700d
commit
15d35b1464
|
|
@ -30,8 +30,8 @@ import (
|
|||
|
||||
type Model struct {
|
||||
ID uint `gorm:"primarykey;comment:id" json:"id"`
|
||||
CreatedAt time.Time `gorm:"column:created_at" json:"created_at"`
|
||||
UpdatedAt time.Time `gorm:"column:updated_at" json:"updated_at"`
|
||||
CreatedAt time.Time `gorm:"column:created_at;type:timestamp;default:current_timestamp" json:"created_at"`
|
||||
UpdatedAt time.Time `gorm:"column:updated_at;type:timestamp;default:current_timestamp" json:"updated_at"`
|
||||
IsDel soft_delete.DeletedAt `gorm:"softDelete:flag;comment:soft delete flag" json:"-"`
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue