mirror of
https://github.com/pawelmalak/flame.git
synced 2024-12-30 14:07:10 +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; |