//THIS IS THE MODEL TO BE INHERITED FROM //THIS SHOULD NOT BE IMPORTED BY SEQUELIZE export default function(sequelize, Sequelize) { return { definition: { // define inheritted model properties to be inheritted here id: Sequelize.INTEGER, related_model_id: Sequelize.INTEGER }, options: { //hooks always return promises hooks: { beforeDestroy(instance, option) { return instance.models.anotherModel.destroy({ where: { id: instance.related_model_id } }) } }, classMethods: { //association relies on context, not pass in models associate: function(){ const {models} = this.sequelize this.belongsTo(models.anotherModel) } } } } }