3 years ago

Multiple Pivot tables and relationships

Posted 3 years ago by jbowman99

I am writing a CRM and I am trying to create several pivot tables to create all of the relationships needed. Users can have several rep_id's so I want to separate these into its own pivot table, where the link is the user_id. A User will have many Advertisers tied to their multiple rep_id's which will be its own pivot table based on Advertiser_id and User_id. A user will also have multiple Sales a sale will be attached to the advertiser in turn attached to the user.

would i just create the basic pivots here using id's as foreign keys? looking for the least convoluted way of tying all these items together. Not sure if other dev's work this way but as I type this out the structure becomes more apparent but your thoughts and ideas are always welcome!!!

Please sign in or create an account to participate in this conversation.