Advertisement
Guest User

Untitled

a guest
May 29th, 2015
235
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.55 KB | None | 0 0
  1. In my system, I have a Shop object, and shops can purchase from other shops. In these scenarios, one shop plays the part of the customer, and the other plays the part of the seller. A customer shop can purchase from many seller shops, and conversely, a seller shop can sell items to many customer shops.
  2.  
  3. I've come up with the following schema to represent this (with each transaction having a category as well:
  4.  
  5. shops(id, name)
  6. transactions(id, customer_shop_id, seller_shop_id, category_id)
  7.  
  8. Question is, how can I represent these relationships in my Shop Model?
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement