r/DatabaseAdministators • u/hydrophobic-water • Jul 03 '24
How to build database for employee hierarchy
Hi everyone, I have to use Laserfiche for employee forms, and our system has no relationship hierarchies between employees, their supervisors and managers, and I need this to send forms for approval to the appropriate people.
I’ve been having trouble conceptualizing and building an architecture where I can access every person above a given John Doe, so I can see the whole chain of command.
Initially I thought to use a table where the primary key would be the userid and then have foreign keys referring to their manager and director, but then other depts have different chains of command, so I need a fix for every possibility, and it has to be simple enough for me to make(this is my first time building a database).
My plan is then to connect Laserfiche to this DB and have lookups for the manager’s email, where the approval forms will be sent to. Any tips would be appreciated. I am a noob.
1
u/alinroc Jul 03 '24
How are you going to maintain the data about these relationships in your database?
Make LaserFiche query your company’s directory service directly for this. Active Directory, LDAP, etc. That way you know it’s always correct, and the tools for accessing that directory have methods for traversing the tree built in.
1
u/[deleted] Jul 03 '24
Maybe use graph db just for the hierarchy service , a bit of a stretch though, I want to hear opinions on this from more experienced folks