I have a post and a notification model. notification has a onPostId FK. When a post is deleted how can I let sequelize know to delete all the notifications that contain that post ID?
Current here is where I set the relationships
post.hasMany(notification, { foreignKey: 'onPostId' }, { onDelete: 'cascade' });
notification.belongsTo(post, { foreignKey: 'onPostId' }, { onDelete: 'cascade' });
On deleting a post I see no alterations to the notifications in my db