Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to remove this parallel hierarchy
    primarykey
    data
    text
    <p>I'm trying to find the best design for the following scenario - an application to store results of dance competitions. </p> <p>An event contains multiple rounds, each round contains a number of performances (one per dance). Each performance is judged by many judges, who return a scoresheet.</p> <p>There are two types of rounds, a final round (containing 6 or less dance couples) or a normal round (containing more than 6 dance couples). Each requires slightly different behaviour and data. </p> <p>In the case of a final round, each scoresheet contains an ordered list of the 6 couples in the final showing which couple the judge placed 1st, 2nd etc. I call these placings "a scoresheet contains 6 placings". A placing contains a couple number, and what place that couple is</p> <p>In the case of a normal round, each scoresheet contains a non-ordered set of M couples (M &lt; the number of couples entered into the round - exact value determined by the competition organiser). I call these recalls: "a score sheet as M recalls". A recall does not contain a score or a ranking</p> <p>for example In a final</p> <ul> <li>1st place: couple 56 </li> <li>2nd place: couple 234 </li> <li>3rd place: couple 198 </li> <li>4th place: couple 98 </li> <li>5th place: couple 3</li> <li>6th place: couple 125</li> </ul> <p>For a normal round The following couples are recalled 54,67,201,104,187,209,8,56,79,35,167,98</p> <p>My naive-version of this is implemented as</p> <p>Event - has_one final_round, has_many rounds</p> <p>final_round - has_many final_performances final_performance - has_many final_scoresheets final_scoresheet - has_many placings</p> <p>round - has_many perforomances performance has_many scoresheets scoresheet has_many recalls</p> <p>However I do not like the duplication that this requires, and I have several parallel hierarchies (for round, performance and scoresheet) which is going to be a pain to maintain.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload