1
0
Fork 0
mirror of https://github.com/pawelmalak/flame.git synced 2025-07-18 19:19:36 +02:00
flame/models/associateModels.js

15 lines
305 B
JavaScript
Raw Permalink Normal View History

2021-05-22 19:04:34 +02:00
const Category = require('./Category');
const Bookmark = require('./Bookmark');
const associateModels = () => {
Category.hasMany(Bookmark, {
foreignKey: 'categoryId',
as: 'bookmarks'
});
Bookmark.belongsTo(Category, {
2021-05-22 19:04:34 +02:00
foreignKey: 'categoryId'
});
}
module.exports = associateModels;