fix(mysql): handle CreateMemo custom timestamps with FROM_UNIXTIME (#5673)
This commit is contained in:
parent
104d2ec0a6
commit
09d73e8b6e
1 changed files with 2 additions and 2 deletions
|
|
@ -29,12 +29,12 @@ func (d *DB) CreateMemo(ctx context.Context, create *store.Memo) (*store.Memo, e
|
||||||
// Add custom timestamps if provided
|
// Add custom timestamps if provided
|
||||||
if create.CreatedTs != 0 {
|
if create.CreatedTs != 0 {
|
||||||
fields = append(fields, "`created_ts`")
|
fields = append(fields, "`created_ts`")
|
||||||
placeholder = append(placeholder, "?")
|
placeholder = append(placeholder, "FROM_UNIXTIME(?)")
|
||||||
args = append(args, create.CreatedTs)
|
args = append(args, create.CreatedTs)
|
||||||
}
|
}
|
||||||
if create.UpdatedTs != 0 {
|
if create.UpdatedTs != 0 {
|
||||||
fields = append(fields, "`updated_ts`")
|
fields = append(fields, "`updated_ts`")
|
||||||
placeholder = append(placeholder, "?")
|
placeholder = append(placeholder, "FROM_UNIXTIME(?)")
|
||||||
args = append(args, create.UpdatedTs)
|
args = append(args, create.UpdatedTs)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue