Readlebee/server/sequelize/associations/Status.js

24 lines
396 B
JavaScript
Raw Normal View History

module.exports = models => {
const {
Status,
User,
ShelfItem,
} = models;
Status.belongsTo(User, {
foreignKey: 'userId',
onDelete: 'CASCADE',
});
Status.belongsTo(PermissionLevel, {
foreignKey: 'permissionLevel',
onDelete: 'SET NULL',
});
Status.belongsTo(ShelfItem, {
foreignKey: 'shelfItemId',
onDelete: 'SET NULL',
});
return Status;
}