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
23 lines
No EOL
396 B
JavaScript
23 lines
No EOL
396 B
JavaScript
module.exports = models => {
|
|
const {
|
|
User,
|
|
PermissionLevel,
|
|
Shelf,
|
|
Status,
|
|
Review,
|
|
Recommendation,
|
|
} = models;
|
|
|
|
User.belongsTo(PermissionLevel, {
|
|
foreignKey: 'permissionLevel',
|
|
onDelete: 'SET NULL',
|
|
});
|
|
User.hasMany(Shelf);
|
|
User.hasMany(Status);
|
|
User.hasMany(Review);
|
|
User.hasMany(Recommendation, {
|
|
foreignKey: 'toUser',
|
|
});
|
|
|
|
return User;
|
|
} |