Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(fix-stage-data-sql): Upsert stage data | NPG-0000 #624

Merged
merged 1 commit into from
Nov 15, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 25 additions & 1 deletion src/event-db/stage_data/dev/00001_fund11_event.sql
Original file line number Diff line number Diff line change
Expand Up @@ -51,4 +51,28 @@ INSERT INTO event (
1, -- Committee Threshold
NULL, -- Extra
NULL -- Cast to
);
) ON CONFLICT (row_id) DO UPDATE
SET name = EXCLUDED.name,
description = EXCLUDED.description,
registration_snapshot_time = EXCLUDED.registration_snapshot_time,
snapshot_start = EXCLUDED.snapshot_start,
voting_power_threshold = EXCLUDED.voting_power_threshold,
max_voting_power_pct = EXCLUDED.max_voting_power_pct,
review_rewards = EXCLUDED.review_rewards,
start_time = EXCLUDED.start_time,
end_time = EXCLUDED.end_time,
insight_sharing_start = EXCLUDED.insight_sharing_start,
proposal_submission_start = EXCLUDED.proposal_submission_start,
refine_proposals_start = EXCLUDED.refine_proposals_start,
finalize_proposals_start = EXCLUDED.finalize_proposals_start,
proposal_assessment_start = EXCLUDED.proposal_assessment_start,
assessment_qa_start = EXCLUDED.assessment_qa_start,
voting_start = EXCLUDED.voting_start,
voting_end = EXCLUDED.voting_end,
tallying_end = EXCLUDED.tallying_end,
block0 = EXCLUDED.block0,
block0_hash = EXCLUDED.block0_hash,
committee_size = EXCLUDED.committee_size,
committee_threshold = EXCLUDED.committee_threshold,
extra = EXCLUDED.extra,
cast_to = EXCLUDED.cast_to;
6 changes: 4 additions & 2 deletions src/event-db/stage_data/dev/00002_fund11_params.sql
Original file line number Diff line number Diff line change
Expand Up @@ -48,12 +48,14 @@ INSERT INTO config (id, id2, id3, value) VALUES (
"score_field": "Rating"
}
}'
);
) ON CONFLICT (id, id2, id3) DO UPDATE
SET value = EXCLUDED.value;

-- Use F11 params for event with row_id = 11.
INSERT INTO config (id, id2, id3, value) VALUES (
'event',
'ideascale_params',
'11',
'{"params_id": "F11"}'
);
) ON CONFLICT (id, id2, id3) DO UPDATE
SET value = EXCLUDED.value;
26 changes: 25 additions & 1 deletion src/event-db/stage_data/testnet/00001_fund10_event.sql
Original file line number Diff line number Diff line change
Expand Up @@ -51,4 +51,28 @@ INSERT INTO event (
1, -- Committee Threshold
NULL, -- Extra
NULL -- Cast to
);
) ON CONFLICT (row_id) DO UPDATE
SET name = EXCLUDED.name,
description = EXCLUDED.description,
registration_snapshot_time = EXCLUDED.registration_snapshot_time,
snapshot_start = EXCLUDED.snapshot_start,
voting_power_threshold = EXCLUDED.voting_power_threshold,
max_voting_power_pct = EXCLUDED.max_voting_power_pct,
review_rewards = EXCLUDED.review_rewards,
start_time = EXCLUDED.start_time,
end_time = EXCLUDED.end_time,
insight_sharing_start = EXCLUDED.insight_sharing_start,
proposal_submission_start = EXCLUDED.proposal_submission_start,
refine_proposals_start = EXCLUDED.refine_proposals_start,
finalize_proposals_start = EXCLUDED.finalize_proposals_start,
proposal_assessment_start = EXCLUDED.proposal_assessment_start,
assessment_qa_start = EXCLUDED.assessment_qa_start,
voting_start = EXCLUDED.voting_start,
voting_end = EXCLUDED.voting_end,
tallying_end = EXCLUDED.tallying_end,
block0 = EXCLUDED.block0,
block0_hash = EXCLUDED.block0_hash,
committee_size = EXCLUDED.committee_size,
committee_threshold = EXCLUDED.committee_threshold,
extra = EXCLUDED.extra,
cast_to = EXCLUDED.cast_to;
Original file line number Diff line number Diff line change
Expand Up @@ -48,12 +48,15 @@ INSERT INTO config (id, id2, id3, value) VALUES (
"score_field": "Rating"
}
}'
);
) ON CONFLICT (id, id2, id3) DO UPDATE
SET value = EXCLUDED.value;

-- Use F10 params for event with row_id = 10.
INSERT INTO config (id, id2, id3, value) VALUES (
'event',
'ideascale_params',
'10',
'{"params_id": "F10"}'
);
) ON CONFLICT (id, id2, id3) DO UPDATE
SET value = EXCLUDED.value;

Loading