From 48ea072d397ef487d7355e99da2e569e51338aa1 Mon Sep 17 00:00:00 2001 From: Mr-Leshiy Date: Wed, 24 May 2023 14:22:55 +0300 Subject: [PATCH] fix --- src/event-db/migrations/V5__vote_plan.sql | 2 +- src/event-db/migrations/V9__vitss_compatibility.sql | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/event-db/migrations/V5__vote_plan.sql b/src/event-db/migrations/V5__vote_plan.sql index 018f0d7224..348f58739f 100644 --- a/src/event-db/migrations/V5__vote_plan.sql +++ b/src/event-db/migrations/V5__vote_plan.sql @@ -23,7 +23,7 @@ COMMENT ON COLUMN voteplan_category.public_key IS 'Does this vote plan category -- groups CREATE TABLE voting_group ( - name TEXT PRIMARY KEY, + name TEXT PRIMARY KEY ); INSERT INTO voting_group (name) diff --git a/src/event-db/migrations/V9__vitss_compatibility.sql b/src/event-db/migrations/V9__vitss_compatibility.sql index 6cd5b07d6c..5f6023342b 100644 --- a/src/event-db/migrations/V9__vitss_compatibility.sql +++ b/src/event-db/migrations/V9__vitss_compatibility.sql @@ -132,10 +132,10 @@ CREATE VIEW voteplans AS SELECT voteplan.category AS chain_voteplan_payload, voteplan.encryption_key AS chain_vote_encryption_key, event.row_id AS fund_id, - voting_group.token_id AS token_identifier + voteplan.token_id AS token_identifier FROM voteplan - INNER JOIN event ON voteplan.event_id = event.row_id - INNER JOIN voting_group ON voteplan.group_id = voting_group.name; + INNER JOIN objective ON voteplan.objective_id = objective.row_id + INNER JOIN event ON objective.event = event.row_id; COMMENT ON VIEW voteplans IS '@omit @@ -242,12 +242,12 @@ SELECT pccc.proposal_metrics, pvp.chain_proposal_index, pvp.chain_voteplan_id, - gr.group_id + voteplan.group_id FROM proposals p INNER JOIN proposals_voteplans pvp ON p.id::VARCHAR = pvp.proposal_id INNER JOIN voteplans vp ON pvp.chain_voteplan_id = vp.chain_voteplan_id INNER JOIN challenges ch ON ch.id = p.challenge_id -INNER JOIN groups gr ON vp.token_identifier = gr.token_identifier +INNER JOIN voteplan ON voteplan.id = vp.chain_voteplan_id LEFT JOIN proposal_simple_challenge psc ON p.proposal_id = psc.proposal_id AND ch.challenge_type = 'catalyst-simple'