I have a case that I do not know which is the best structure of the relational database.
User
- ID
- Name
Task
- ID
- Name
I want the following conditions to be met
My solution was to put a new table called
Responsible
- ID
- Responsible (User.id)
- Who_assigns (User.id)
- Task (Task.id)
Then with programming I would perform a validation:
if( User.id == Responsable.Quien_asigna )
TareasCreadasPorUsuario.AgregarTarea()
Mostrar(TareasCreadasPorUsuario);
But, I was wondering if it would not be better, or if it was possible to put something like that better.
Task
- ID
- Name
- Responsible [Responsible, Who_assigns]
And at the end in programming
for(Responsable in Tarea.Responsables)
if( User.id == Responsable.Quien_asigna )
TareasCreadasPorUsuario.AgregarTarea()
Mostrar(TareasCreadasPorUsuario);