A very basic design question here. I would like to build a scalable app and would want to know what's the best way forward.
So in the database there are two tables :
users has the following fields:
-id -name -company_id -join_date -leave_date
companies has the following fields:
-id -admin_id -address
I want a 1-to-M between
companies as one company could have many users, but one user belongs to only one company. Also, I want to have a 1-to-1 on
companies because one company has one admin and vice versa.
I'm not sure if I am tackling this right. The admin role would basically have more privileges on the system. But I cannot understand if it should be a 1-to-1 or not. Who would the parent be, etc.