Skip to content

Commit

Permalink
Fix: mongodb adds data model to set update time (#808)
Browse files Browse the repository at this point in the history
  • Loading branch information
nuclearwu committed May 9, 2023
1 parent 872f162 commit 55380e2
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions pkg/server/infrastructure/datastore/mongodb/mongodb.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ func (m *mongodb) Add(ctx context.Context, entity datastore.Entity) error {
return datastore.ErrTableNameEmpty
}
entity.SetCreateTime(time.Now())
entity.SetUpdateTime(time.Now())
if err := m.Get(ctx, entity); err == nil {
return datastore.ErrRecordExist
}
Expand Down

0 comments on commit 55380e2

Please sign in to comment.