I am trying to model a database for my current project and I came across a new problem. I have a Project
which is supervised by Supervisor
, Coordinator
and Company
. So Project table has Supervisor.id
as foreign key and so on. There is also Student
table which contains Project.is
as a foreign key (because many users can do a project). This is how it is right now. What I would like to do is to have a User
table containing a column named type
which allows me to see what the role of that particular user is (also student). Even though the table will contain many NULL
entries, I will have far less redundant code.
However, the main reason I want to have one User
table is that I am using CakePHP and it is not easy to have different models log in. Is this possible in a nice way?
Thanks
EDIT: Maybe I should say that every one of these roles will have different permissions.