Coming soon - Get a detailed view of why an account is flagged as spam!
view details

This post has been de-listed

It is no longer included in search results and normal feeds (front page, hot posts, subreddit posts, etc). It remains visible only via the author's post history.

8
Help with modelling a 3-way many-to-many relationship
Post Body

I'm new to data modelling, and I'm working on a data model and ERD for an OKR (Objectives & Key Results) tool.

In my model I have Users, Teams and Managers (which are actually also Users). There are many-to-many relationships between Users and Teams and between Users and Managers(Users). I'm now looking to add an additional many-to-many relationship between Teams and Managers, and I don't know how to proceed.

The end result is that a User can select a Team to which they have a relationship, and then select a Manager that is both a Manager of the Team and a Manager of the User.

Current Tables:

TableName Fields
User id [pk], name, email, ...
Team id [pk], name, ...
UserManager user_id [fk=User.id], manager_id [fk=User.id]
UserTeam user_id [fk=User.id], team_id [fk=Team.id]

I was thinking about adding am is_manager bit value to the UserTeam table to indicate whether a specific user is also a manager of this Team, but I didn't like the idea of also having Managers identified through the UserManager table.

Thoughts on a better way to proceed? Thanks.

Author
Account Strength
90%
Account Age
5 years
Verified Email
Yes
Verified Flair
No
Total Karma
2,193
Link Karma
1,318
Comment Karma
732
Profile updated: 6 days ago
Posts updated: 8 months ago

Subreddit

Post Details

We try to extract some basic information from the post title. This is not always successful or accurate, please use your best judgement and compare these values to the post title and body for confirmation.
Posted
3 years ago