mirror of
https://github.com/pawelmalak/flame.git
synced 2024-12-19 16:21:48 +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; |