Skip to content
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

Model.associate adding new columns #1353

Open
AbdBpal opened this issue Aug 2, 2023 · 0 comments
Open

Model.associate adding new columns #1353

AbdBpal opened this issue Aug 2, 2023 · 0 comments

Comments

@AbdBpal
Copy link

AbdBpal commented Aug 2, 2023

What you are doing?

I wanted to access all models from a single file so I used the index.js file in the models directory and accessed them like so
image
image

this worked with User because it has no associations but when I tried the products table I got an error
image
the association added a new column for every belongsTo() call so now it's trying to select columns that aren't anywhere in my models, migration or database

Dialect: mysql
Sequelize CLI [Node: 18.12.0, CLI: 6.6.1, ORM: 6.32.1]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant