Data model for timesheet to task and/or timesheet to project? -
let's want make simple project tracking system. manager can create project. can create tasks project. team members can record hours work each task or project whole.
is following design t_timesheet table idea?
timesheet_id - primary key, autoincrement project_id - not null, foreign key constraint t_project task_id - nullable, foreign key constraint t_task user_id - not null, foreign key constraint t_user hours - decimal
or should this:
timesheet_id - primary key, autoincrement task_id - not null, foreign key constraint t_task user_id - not null, foreign key constraint t_user hours - decimal
in second option, intend have record in t_task labelled "miscellaneous items" foreign key relevant t_project record. i'll able track hours project aren't particular task.
are of ideas above good? better?
while believe nullable foreign keys have place in relational databases, in case tend towards second option.
forces project manager explicitly create "micellaneous items" task per project make them decide if makes sense project in question or not.
allows project manager call catch task whatever want.
will user interface there won't need special case assign work against project directly , not task.
will make writing reports easier developers have deal less complicated database model.
Comments
Post a Comment