Please excuse the title, I had problems with the wording of my question, not being overly descriptive.
My application has tables that like it:
contacts
Properties
<Strong> events
I am adding a method to attach notes to elements in the above tables. I would like one note to be associated with a contact, property or event (or a combination of three).
Currently, the notes table is as follows:
noteID int
noteCreated datatime
noteContent text
userID int (userid that created the note)
contactID int
propertyID int
eventID int
The part in question is in bold. Right now, when I create a note for an event , I just insert a note and also set eventID . If the event also refers to a contact , I can add contactID (contactID and eventID will be set). Although it works, I believe that it is inefficient and not normalized.
, , " ", , "" . , .
, , , targetType, . , . (notes_properties, notes_contacts ..).
noteID int
targetID int
targetType int
. :)