diff --git a/manager/models/audit.go b/manager/models/audit.go index ce861868c..fa2f95d3a 100644 --- a/manager/models/audit.go +++ b/manager/models/audit.go @@ -60,7 +60,7 @@ type Audit struct { // Operation represents the operation, it will be the HTTP method for API events. Operation string `gorm:"column:operation;type:varchar(256);not null;comment:operation" json:"operation"` // OperatedAt represents the operation time. - OperatedAt time.Time `gorm:"column:operated_at;type:timestamp;not null;comment:operation time" json:"operated_at"` + OperatedAt time.Time `gorm:"column:operated_at;type:timestamp;default:current_timestamp;comment:operated at" json:"operated_at"` // State represents the state, it indicates the state of the operation, e.g SUCCESS for API status code >= 200 & < 300. State string `gorm:"column:state;type:varchar(100);not null;comment:state" json:"state"` // Path represents the request path, it will be the URL path for API events. diff --git a/manager/models/models.go b/manager/models/models.go index 50cf58850..58c7cf971 100644 --- a/manager/models/models.go +++ b/manager/models/models.go @@ -30,8 +30,8 @@ import ( type BaseModel struct { ID uint `gorm:"primarykey;comment:id" json:"id"` - 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"` + CreatedAt time.Time `gorm:"column:created_at;type:timestamp;default:current_timestamp;comment:created at" json:"created_at"` + UpdatedAt time.Time `gorm:"column:updated_at;type:timestamp;default:current_timestamp;comment:updated at" json:"updated_at"` IsDel soft_delete.DeletedAt `gorm:"softDelete:flag;comment:soft delete flag" json:"is_del"` }