2212-grace-shopper-triceratops / tri-grace-shopper

0 stars 3 forks source link

add model associations #42

Open allyssad opened 1 year ago

allyssad commented 1 year ago
Order.hasMany(Order_Detail);
Order_Detail.belongsTo(Order);
Order.belongsTo(User);
User.hasMany(Order);

User.hasOne(Shipping)
Shipping.belongsTo(User)
User.hasMany(Payment)
Payment.belongsTo(User)
User.belongsTo(Currency)
Currency.hasMany(User)

Product.belongsToMany(Tag, {through: 'Product_Tags'})
Tag.belongsToMany(Product, {through: 'Product_Tags'})