1
0
Fork 0
mirror of https://gitlab.com/Alamantus/Readlebee.git synced 2025-07-09 09:34:16 +02:00
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;
}