From 1a3990bfb65502c5e76c374d92cfadc476926172 Mon Sep 17 00:00:00 2001 From: Laura Beaufort <31420082+lbeaufort@users.noreply.github.com> Date: Mon, 11 Jun 2018 13:14:29 -0400 Subject: [PATCH] Remove extra condition on join that was causing calculation error --- data/migrations/V0084__fix_ofec_candidate_totals_mv.sql | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/data/migrations/V0084__fix_ofec_candidate_totals_mv.sql b/data/migrations/V0084__fix_ofec_candidate_totals_mv.sql index 77154b514..813762e8d 100644 --- a/data/migrations/V0084__fix_ofec_candidate_totals_mv.sql +++ b/data/migrations/V0084__fix_ofec_candidate_totals_mv.sql @@ -1,7 +1,8 @@ /* -Addresses #3196 +Addresses #3196 and #3200 -Fix doubled totals for off-year special election candidates +#3196: Fix doubled totals for off-year special election candidates +#3200: Fixes missing off-year special candidates - Recreate ofec_candidate_totals_mv - Recreate two dependent views: @@ -245,8 +246,8 @@ CREATE MATERIALIZED VIEW ofec_candidate_totals_with_0s_mv AS FROM ofec_candidate_history_mv cand LEFT JOIN ofec_candidate_totals_mv totals ON cand.candidate_id = totals.candidate_id - AND cand.candidate_election_year = totals.election_year AND cand.two_year_period = totals.cycle; + --Removed overly restrictive join that was preventing some candidates from appearing --Permissions-------------------