dimanche 3 juillet 2016

Database representation of a timeline

Say I have a timeline which displays 2 kinds of events:

  1. A patient has visited a clinic. Such an event references to the patient and the clinic.
  2. A patient has uploaded a photo. Such an event references to the patient and the photo.

So I have a few underlying tables here: patients, clinics, photos.
I also have a few timeline tables: timeline_visit, timeline_photo.

The question is am I forced to use separate tables for every timeline event type and then use UNION to build a complete timeline or there are some other techniques that I don't know about (to store all the possible events in one table)?
The tables timeline_visit and timeline_photo have common and differing fields and keys as you can see.

Aucun commentaire:

Enregistrer un commentaire