This repository has been archived by the owner on Nov 5, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 37
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This removes the rewards_pkey constraint since reward_type adds duplicate account/gateway/block constraint violations. There are other indices for gateway/account so this should hopefully not affect rewards query performance
- Loading branch information
Showing
2 changed files
with
124 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
-- migrations/1637295492-rewards_type.sql | ||
-- :up | ||
|
||
DO $$ | ||
BEGIN | ||
IF NOT EXISTS (SELECT 1 FROM pg_type WHERE typname = 'reward_type') THEN | ||
create type reward_type as ENUM ( | ||
'poc_challenger', | ||
'poc_challengee', | ||
'poc_witness', | ||
'dc_rewards', | ||
'consensus_rewards', | ||
'securities_reward' | ||
); | ||
END IF; | ||
END | ||
$$; | ||
|
||
alter table rewards add column type reward_type; | ||
|
||
alter table rewards drop constraint if exists rewards_pkey; | ||
|
||
-- :down | ||
|
||
alter table rewards drop column type; | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters