Open bzzanui opened 1 year ago
Having the same issue. I have to add them manually each time.
@steveschmitt I created a PR for this. Can you help to review? thanks https://github.com/sequelize/sequelize-auto/pull/626
@lptai Your PR doesn't seem to address the declare
issue.
currently working on a fork for the same issue https://github.com/rachid-debu-prbob/sequelize-auto-bob i'm also adding a caseAlias property to customize aliases casing.
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 Then let your npm install to patch it.
Hope this will help anyone using this library to auto generate exist DB to sequelize model in typescript
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?