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