Forum Discussion
Help figuring out schema with circular relationship
Hi all, hopefully this is a good place to ask for help with this. I am designing the below schema but I have run into an issue where I am seeing a circular reference. Let me explain a bit about what my data is:
Patients have procedures (surgeries) and from those multiple "Parts" of tissue are taken. Those parts are broken down further into specimens (small pieces) and then stained slides are made from those. On the other side, our job is to run tests on these specimens, but only select specimens will be used. So "Cases" (which is like a request) can have multiple different types of tests, and those tests are run on the Specimens of the related Part. So for each test/activity, it needs to be decided which Specimen should be used.
To me, that means relating Activities to Specimens (using a join table, ActivityMaterials, since specimens could be used across multiple activities if needed and multiple specimens can be used for a single activity), but this then creates a circular relationship since these two entities are already connected through the Part. Do I even need to make this join table, or is the relationship through the Part enough?
1 Reply
- amitchandakSuper User
You have two many Bi-directional joins. Make all 1-M joins as single directional. In need do the same with 1-1 ( make them 1-M if you are sure of ) and then check.