Database logic model for orders, customers and suppliers

Hi everyone,

I’m struggling to find a solution to get my app’s database logic model to do what I want, so I’m looking for some guidance

This is a simple logic model.

(Productos = Products, Pedidos = Orders)

This should be a single app both for buyers and suppliers. I have a single source of login (users table) where I added a flag to indicate whether this specific user is either a supplier or buyer so I can forward them to the right path within the app.

The products collection has a 1 to many relationship with the users table, so a user can have multiple products but a product should belong to a single user.


The orders collection has two relationships: 1 to many with respect to users (1 user can have multiple orders but orders should belong to a single user) and many to many with respect to products


I already know this is not the model I should follow because I’m mixing up orders from both suppliers and buyers.

Any idea on what’s the best way to design this? Do I need a separate table for all dimensions (products and orders) for each player (buyers and suppliers)?