I am trying to creat an assistion between my tables like this:
Customers.associate = (models) => {
Customers.hasMany(models.Addresses, {foreignKey: 'id', as: 'aId',
onDelete: "cascade",
});
Customers.hasMany(models.Orderline, {
onDelete: "cascade",
});
};
I have a customers table where a customer can have many addresses if they wish and many orders. I keep getting this error:
throw new Error(${this.name}.hasMany called with something that's not a subclass of Sequelize.Model
);
Error: Customers.hasMany called with something that's not a subclass of Sequelize.Model
I have looked online for suggestions but I´m still stuck. Thanks for any help/guidance.