I need some guidance for a database design around a project management system. My question is mainly around how should I design the columns or tables for functionality around the various Roles.
The system will have several users in a Users table and the following roles in Roles table
(Company Adminis, Project Manager, Supervisor, Alternate Supervisor, Employee)
The various entities involved are Users, Roles, UserRoleMapping, Company, Projects
- A company has many Projects and has one ore more Company Administrators
- Every Project has a Project Manager
- Every Project has several Employees assigned to it
- Each Employee has a Supervisor
I am looking for a good db design that would translate well to an Entity Framework model.
This is the approach I have thought of and would appreciate any feedback:
Use default ASP.NET Membership that would provide Users, Roles, UserRoleMapping functionality.
Then, using the base Users table from Membership and creating Role specific tables to store various users: Employees, CompanyAdmins, Supervisors
UPDATE TWO: Please see the new image below. Thinking of using a Table per Hierarchy to store the various managers (Company Admins for a company, Project Manager for a project, Supervisor for an employee) in the same table.
What do you think of this as the database design and please suggest how this would work for the Entity Model?

Also, on another note – do you think the way I have connected Project, Tasks and Employees is correct?
Thanks.
How big could the employee table get? In their role as administrator, supervisor or manager, all of those are employees (they may or may not have a supervisor though). Can an employee be assigned to several projects? Can an employee be assigned multiple projects? In my case, an employ could be assigned to only one project at a time (or in the case of certain employees, none). This allowed me to modify a basic employee object like so:
EmpID
[Employee info]
SupervisorID (can be null and is an employee_id)
AlternateSupervisorID (can be null and is an employee_id)|Project_ID (can be null) and is a FK
only other object is project with a PK of project_id.