Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Creating database table

I am creating a database table for investigations and i need to log the person who reported the incident, this could be a record from the supplier or user tables. The easiest way to do this would be to have both a suppleir and a user id column in my investigations table but that seems wrong, what's a better way to do this?

Thank you.

like image 321
slex Avatar asked Aug 20 '12 09:08

slex


1 Answers

You could have another two tables - IncidentsReportedBySupplier (IncidentID, SupplierID) and IncidentsReportedByUser (IncidentID, UserID) - which would remove the empty columns.

But this has disadvantages too. You can then potentially have incidents which aren't reported by anybody.

like image 199
podiluska Avatar answered Sep 28 '22 09:09

podiluska