db.Save updates CreatedAt with a zero value.
szerr opened this issue · comments
szerr commented
GORM Playground Link
Description
db.Save updates CreatedAt with a zero value. Then throws an error. Gorm should automatically handle CreatedAt and ignore zero values, right?
db.Create sets UpdatedAt to the current time, shouldn't it be null?
Jinzhu commented
Create
will fill the created_at field if it is empty, but Save
will not do so with a blank primary key.