Skip to content

Commit e830859

Browse files
committed
feat(manager): add default value for operated_at
Signed-off-by: Gaius <gaius.qi@gmail.com>
1 parent d0bfdd4 commit e830859

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

manager/models/audit.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ type Audit struct {
6060
// Operation represents the operation, it will be the HTTP method for API events.
6161
Operation string `gorm:"column:operation;type:varchar(256);not null;comment:operation" json:"operation"`
6262
// OperatedAt represents the operation time.
63-
OperatedAt time.Time `gorm:"column:operated_at;type:timestamp;not null;comment:operation time" json:"operated_at"`
63+
OperatedAt time.Time `gorm:"column:operated_at;type:timestamp;default:current_timestamp" json:"operated_at"`
6464
// State represents the state, it indicates the state of the operation, e.g SUCCESS for API status code >= 200 & < 300.
6565
State string `gorm:"column:state;type:varchar(100);not null;comment:state" json:"state"`
6666
// Path represents the request path, it will be the URL path for API events.

0 commit comments

Comments
 (0)