Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
don't overwrite options.foreignKey in associations #4927
I use sequelize quite often and just discovered are rare case where it doesn't exactly do what imho it is supposed to do. Let's assume we have three tables, where A & B have a string ID and C has an integer ID. Now when we try to connect B and C with A, we run into the problem that if a foreignKey is given as input, it will be modified by the associations. Hence this to this weird behavior:
Note: CId should be an integer.
This is due to the fact that we use the same
This PR adds a very simple fix for this problem and also a test case to check for this ;-)