sequelize / cli

The Sequelize CLI
MIT License
2.53k stars 528 forks source link

Model.associate adding new columns #1353

Open AbdBpal opened 1 year ago

AbdBpal commented 1 year ago

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]