diff --git a/db/schema.rb b/db/schema.rb index 54e436acf..7e951d623 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -1052,9 +1052,9 @@ lottery_divisions.name AS division_name, ranked_draws.division_rank, CASE + WHEN lottery_entrants.withdrawn THEN 4 WHEN (ranked_draws.division_rank <= lottery_divisions.maximum_entries) THEN 0 WHEN (ranked_draws.division_rank <= (lottery_divisions.maximum_entries + lottery_divisions.maximum_wait_list)) THEN 1 - WHEN lottery_entrants.withdrawn THEN 4 WHEN (ranked_draws.division_rank IS NOT NULL) THEN 2 ELSE 3 END AS draw_status diff --git a/db/views/lotteries_division_rankings_v02.sql b/db/views/lotteries_division_rankings_v02.sql index ad64bb571..203d5d89e 100644 --- a/db/views/lotteries_division_rankings_v02.sql +++ b/db/views/lotteries_division_rankings_v02.sql @@ -22,9 +22,9 @@ select lottery_entrants.id as lottery_entrant_id, -- not_drawn: 3 -- withdrawn: 4 case + when lottery_entrants.withdrawn then 4 when division_rank <= maximum_entries then 0 when division_rank <= maximum_entries + maximum_wait_list then 1 - when lottery_entrants.withdrawn then 4 when division_rank is not null then 2 else 3 end as draw_status from lottery_entrants diff --git a/erd.pdf b/erd.pdf index fc4daf30c..bc193aed0 100644 Binary files a/erd.pdf and b/erd.pdf differ