Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 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.
- I've come up with the following schema to represent this (with each transaction having a category as well:
- shops(id, name)
- transactions(id, customer_shop_id, seller_shop_id, category_id)
- Question is, how can I represent these relationships in my Shop Model?
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement