1
0
Fork 0
mirror of https://gitlab.com/Alamantus/Readlebee.git synced 2025-05-15 06:31:17 +02:00
Readlebee/server/sequelize/associations/ShelfItem.js
Robbie Antenesse 071e1e6586 Update sequelize & DB setup:
- Split models & associations into their own files
- Update columns and requirements
- Create PermissionLevel model & add to relevant models
2020-01-14 15:47:44 -07:00

22 lines
No EOL
349 B
JavaScript

module.exports = models => {
const {
ShelfItem,
Shelf,
BookReference,
Status,
} = models;
ShelfItem.belongsTo(Shelf, {
foreignKey: 'shelfId',
onDelete: 'CASCADE',
});
ShelfItem.belongsTo(BookReference, {
foreignKey: 'bookId',
onDelete: 'CASCADE',
});
ShelfItem.hasMany(Status);
return ShelfItem;
}