I’m not sure how to explain this so I am going to try do it as clearly as I can.
We have a case logging web app. When one adds a case ticket, one can add contacts and attachments to that ticket.
I am trying to find a way for the visitor to fill in the case ticket information, add n contacts and then n attacheents before having to push save.
The attachments and contacts are linked to the ticket table and so will need to know the tickets Id in order to insert the correct reference Id.
What are the different solutions that can be implemented?
One option is to introduce linking tables; so instead of:
you could have:
Now you can save
contactrecords beforeticket(orticketfirst) – and just add in the linking records when you have both. This also allows you to re-usecontactin scenarios unrelated toticket.Another (simpler) option is just to make the FK nullable… that might be OK I guess.