module.exports = function(sequelize, DataTypes) {
var MenuTranslation = sequelize.define('MenuTranslation', {
name: DataTypes.STRING,
description: DataTypes.STRING
},{
tableName: 'menu_translations',
timestamps: false,
associate: function(models){
MenuTranslation.belongsTo(models.Menu, { onDelete: 'cascade' });
MenuTranslation.belongsTo(models.Language);
}
});
return MenuTranslation;
};
更新:我将“onDelete:'cascade'”添加到我的MenuTranslation模型中。但这一次它就像onDelete:'null'