New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Typescript Model missing field CreatedAt and UpdatedAt type error #625
Comments
Having the same issue. I have to add them manually each time. |
…are missing in ts definition
@steveschmitt I created a PR for this. Can you help to review? thanks |
@lptai Your PR doesn't seem to address the |
currently working on a fork for the same issue |
Hi All, I don't have time to fix all the source code of this repo to create PR for this issue but I do have a patch to fix this issue in version 0.8.8 https://github.com/benzhanghf/sequelize-auto/blob/master/patches/sequelize-auto%2B0.8.8.patch You can download the patch file and put in your project /patches/sequelize-auto+0.8.8.patch Hope this will help anyone using this library to auto generate exist DB to sequelize model in typescript |
…are missing in ts definition
Like the doc said:
https://sequelize.org/docs/v6/other-topics/typescript/
For typescript even those fields are sequelize managed timestamps you will still need the name in the Table.init function
in the node_modules/sequelize-auto/lib/auto-generator.js
Also as the doc recommend Model property should be declare not real property to prevent accidentally set the value from property not from DB ORM such as this, can we add the declare instead of property?
The text was updated successfully, but these errors were encountered: