Quantcast
Viewing all articles
Browse latest Browse all 60

More than one path between M-M tables

I'm trying to figure out if it is bad practice to have more than one path between tables that are related via many-to-many relationships.

I have 3 user-facing tables: Dupe, Cue, and Take. There is a many-to-many relationship between Dupes and Cues, and there is a many-to-many relationship between Takes and the join table Dupe_Cues.

Image may be NSFW.
Clik here to view.
database schema diagram

The user can add, delete, and modify Cues, Dupes and Takes, and she can make links between Cues/Dupes and Cues/Takes, but there are also certain situations when the user will want to directly add a Take to a Dupe, without creating a cue. So I figure the simplest thing to do is create a Dupe_Take table. The problem is, I'm worried it will cause referential issues and isn't good database design.

If I don't create a Dupe_Take table, I suppose I could add a field to the Cue table, like "b_CreatedByUser". Then, whenever the user does a query, I filter out Cues where b_CreatedByUser=FALSE so that Cues that are only used to link Takes to Dupes are never shown to the user, but that sounds sloppy and difficult to maintain.

What is the best practice? What factors should I be considering?

Thanks for any advice.


Viewing all articles
Browse latest Browse all 60

Trending Articles