Answer the question
In order to leave comments, you need to log in
Are foreign keys needed for a one to many relationship table?
Hello. Subject. If they are needed, then what about a situation where, for example, there is a table with complaints, a table with images, and a linking table?
Suppose someone submitted a complaint about images 1, 2 and 3. Then another complaint about images 2 and 4 comes in. So if I try to delete image 2, I will get a constraint on complaint 2. How to be in such a situation? I understand that you can delete all records with image_id=2 from the link table, but this is an extra crutch in the ORM, besides, who knows, maybe the deleted records from the link table will be needed to answer the client or some statistics.
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question