-
-
Notifications
You must be signed in to change notification settings - Fork 4k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Updates cant auto set updated_at when strcut dont have Updated_at field. #7226
Comments
Hi, |
Hi again, |
Hi, 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. |
Hi @jinzhu, 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-gen 结构体转查询语句的方案呀? |
想联系你 不知道怎么联系 谢谢 @hinego |
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: