You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I was going through the association docs to create foreign key constraints for my tables in sqlite but i noticed when using Model.HasMany(Child) by default the foreign key definition is allowNull: true which defeats the purpose of using a foreign key constraint.
Issue Description
I was going through the association docs to create foreign key constraints for my tables in sqlite but i noticed when using
Model.HasMany(Child)
by default the foreign key definition isallowNull: true
which defeats the purpose of using a foreign key constraint.https://sequelize.org/docs/v6/core-concepts/assocs/
Im not sure if i missed anything but i couldnt find this anywhere in the docs and the associations docs doesnt explain this behavior properly.
Let me know if i'm missing anything
Additional context
This code would define the foreign key
employeeId
withallowNull:true
I had to refactor the code to this for the foreign key constraint to be effective
The text was updated successfully, but these errors were encountered: