-
Notifications
You must be signed in to change notification settings - Fork 771
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
Please provide an example using sequelize v5 and TypeScript. #97
Comments
Yes, definitely, this is something I want to do in the near future. |
@papb I made a example using sequelize v5 and TypeScript. But I met an issue, it blocks me one week. Can you help me solve this issue? I also submitted a post on stackoverflow, but it still has no working answer. I am thinking if the organization of models is correct or not. Here is the post on SO: https://stackoverflow.com/questions/60054969/belongs-to-many-associations-add-foreign-keys-to-source-model-sequelizedatabase Here is the example repo: https://github.com/mrdulin/node-sequelize-examples/tree/master/src/db Thanks! |
I figured it out. |
Hi @mrdulin sorry I couldn't give you more attention, I have too little time hehe. Glad you figured it out. Can you please share it? Or update your github repository? When I have time I would like to take a look and incorporate it as an example for this repository, of course giving all credits to you. Thank you very much. |
@papb I made a stupid mistake. I passed a wrong |
In particular, how to organize the models when using sequelize v5 and TypeScript?
I wonder can we remove this setup file: https://github.com/sequelize/express-example/blob/master/models/index.js and organize the models file just using
export
andimport
, and combine these models using some method.The setup file executes immediately when importing it, or import some modules depend on it. Sometimes, It will affect the unit test when importing some modules into test files.
E.g.
models/index.ts
:The text was updated successfully, but these errors were encountered: