mirror of
https://github.com/pawelmalak/flame.git
synced 2024-12-24 10:42:40 +03:00
15 lines
305 B
JavaScript
15 lines
305 B
JavaScript
const Category = require('./Category');
|
|
const Bookmark = require('./Bookmark');
|
|
|
|
const associateModels = () => {
|
|
Category.hasMany(Bookmark, {
|
|
foreignKey: 'categoryId',
|
|
as: 'bookmarks'
|
|
});
|
|
|
|
Bookmark.belongsTo(Category, {
|
|
foreignKey: 'categoryId'
|
|
});
|
|
}
|
|
|
|
module.exports = associateModels; |