Skip to content

Commit 09d99d3

Browse files
authored
fix: remove the gorm tag for CreatedAt and UpdatedAt (#3990)
fix: remove the gorm tag for CreatedAt and UpdatedAt to avoid conflict with gorm internal Signed-off-by: chlins <chlins.zhang@gmail.com>
1 parent 2d331fc commit 09d99d3

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

manager/models/models.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@ import (
3030

3131
type BaseModel struct {
3232
ID uint `gorm:"primarykey;comment:id" json:"id"`
33-
CreatedAt time.Time `gorm:"column:created_at;type:timestamp;default:current_timestamp;comment:created at" json:"created_at"`
34-
UpdatedAt time.Time `gorm:"column:updated_at;type:timestamp;default:current_timestamp;comment:updated at" json:"updated_at"`
33+
CreatedAt time.Time `json:"created_at"`
34+
UpdatedAt time.Time `json:"updated_at"`
3535
IsDel soft_delete.DeletedAt `gorm:"softDelete:flag;comment:soft delete flag" json:"is_del"`
3636
}
3737

0 commit comments

Comments
 (0)