You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[<!--
To ensure your issue be handled, the issue MUST include a GORM Playground Pull Request Link that can reproduce the bug, which is important to help others understand your issue effectively and make sure the issue hasn't been fixed, refer: https://github.com/go-gorm/playground
Without the link, your issue most likely will be IGNORED
Hi again,
I’m currently working on this issue. I’ve successfully reproduced the problem and identified the specific section of the code that’s causing it. I’m now focusing on finding a solution
You should change the struct field type to time.Time and use the gorm:"autoCreateTime" annotation for automatic handling of the created_at field, and gorm:"autoUpdateTime" for the updated_at field. This ensures that GORM automatically manages the timestamps during record creation and updates.
Additionally, make sure that the corresponding database columns are of type TIMESTAMP. Changing the field type to time.Time in your Go struct will ensure that GORM properly maps these fields to MySQL's TIMESTAMP data type, allowing for correct storage and automatic timestamp handling without manual intervention.
I've investigated this issue and found that it’s not valid as described. The current functionality meets the expected behavior, and no changes are necessary at this time. So, I recommend closing the issue.
GORM Playground Link
[<!--
To ensure your issue be handled, the issue MUST include a GORM Playground Pull Request Link that can reproduce the bug, which is important to help others understand your issue effectively and make sure the issue hasn't been fixed, refer: https://github.com/go-gorm/playground
Without the link, your issue most likely will be IGNORED
CHANGE FOLLOWING URL TO YOUR PLAYGROUND LINK
-->
go-gorm/playground#761
Description
The text was updated successfully, but these errors were encountered: