DB Design Question
Posted
by hazimdikenli
on Stack Overflow
See other posts from Stack Overflow
or by hazimdikenli
Published on 2009-06-21T21:05:05Z
Indexed on
2010/03/31
21:03 UTC
Read the original article
Hit count: 339
data-modeling
|database-design
I am designing an Org Chart, model is almost ready and simplified a bit for clarity here.
OrgUnit (OrgUnitId, Name, ReportsToOrgUnitId, ...)
OrgUnitJobs (OrgUnitJobId, OrgUnitId, JobName, ReportsToOrgUnitJobId, ... ,IsJobGroup)
Employee (EmployeeId, ........)
OrgUnitJobEmployee (OrgUnitJobId, EmployeeId, AssignedDate, .....,)
so I want to know every OrgUnit's ManagerEmployee (should have one), and Employees can have more than one job, but one of them has to be the main job, so I know whats his manager and other stuff. This is going to support a little workflow behind the scnese, so that is why it is not a very simple Org chart Model.
so what would you do, would you add properties like (IsManager property to OrgUnitJobs model) or add ManagerOrgUnitJobId to OrgUnitModel. and why?
Likewise, for employees would you add IsPrimaryJob property to OrgUnitJobEmployee model, or add PrimaryJobId to Employee Model.
© Stack Overflow or respective owner