mirror of
https://github.com/pawelmalak/flame.git
synced 2024-12-23 18:23: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; |