go-zero
go-zero copied to clipboard
Modify model templates, removing the placeholders of CreateTime and UpdateTime makes the generated code not working.
![image](https://user-images.githubusercontent.com/9651736/176599745-6f7109c5-f53e-4221-b1d8-b2a0b89b70f0.png)
![]()
这里我删除model的vars.tpl的模板,去掉字段生成时忽略的createtime和updatetime,会导致重新生成的代码,所有的model接口都不能正常的工作,insert会报字段不匹配的错误。因为我们的项目,时间都是用int64来表达的。
建议不要用同名字段,使用create_at和update_at替换,没必要在这里和模版做冲突
好像你可以把模版改成CreateAt和UpdateAt,如果你是历史项目的话 没有历史包袱的新项目就别头铁
Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑🤝🧑👫🧑🏿🤝🧑🏻👩🏾🤝👨🏿👬🏿
Seems like you can change the template to Created_At and Updated_At if you are historical project Don't give up on new projects without historical baggage
这里确实存在这个问题,我正在寻找解决方案 That's a problem in model code generation, I'm looking for a solution to solve it.
This issue is stale because it has been open for 30 days with no activity.