Skip to content

Commit

Permalink
chore(fix-stage-data-sql): Upsert event-db stage data (#152)
Browse files Browse the repository at this point in the history
  • Loading branch information
FelipeRosa authored Nov 16, 2023
1 parent a1016af commit 2d0ae61
Show file tree
Hide file tree
Showing 4 changed files with 58 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -51,4 +51,30 @@ 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 @@ -56,4 +56,5 @@ INSERT INTO config (id, id2, id3, value) VALUES (
'ideascale_params',
'0',
'{"params_id": "TestFund"}'
);
) ON CONFLICT (id, id2, id3) DO UPDATE
SET value = EXCLUDED.value;
Original file line number Diff line number Diff line change
Expand Up @@ -51,4 +51,30 @@ 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 @@ -56,4 +56,5 @@ INSERT INTO config (id, id2, id3, value) VALUES (
'ideascale_params',
'10',
'{"params_id": "F10"}'
);
) ON CONFLICT (id, id2, id3) DO UPDATE
SET value = EXCLUDED.value;

0 comments on commit 2d0ae61

Please sign in to comment.