mirror of
https://gitlab.com/Alamantus/Readlebee.git
synced 2025-05-15 06:31:17 +02:00
- Split models & associations into their own files - Update columns and requirements - Create PermissionLevel model & add to relevant models
22 lines
No EOL
349 B
JavaScript
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;
|
|
} |