Sequelize.js onDelete: ‘cascade’ is not deleting records sequelize
I believe you are supposed to put the onDelete in the Category model instead of in the products model. module.exports = function(sequelize, DataTypes) { var Category = sequelize.define(‘Category’, { name: { type: DataTypes.STRING, allowNull: false } }, { associate: function(models) { Category.hasMany(models.Product, { onDelete: ‘cascade’ }); } }); return Category }