-
Notifications
You must be signed in to change notification settings - Fork 434
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
(BIDS-2465) use new table validator_stats_total for all fields in val…
…idator_stats
- Loading branch information
Showing
4 changed files
with
398 additions
and
6 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
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,68 @@ | ||
-- +goose Up | ||
|
||
-- +goose StatementBegin | ||
ALTER TABLE validator_stats ADD COLUMN IF NOT EXISTS missed_attestations_total INT NOT NULL DEFAULT 0; | ||
ALTER TABLE validator_stats ADD COLUMN IF NOT EXISTS orphaned_attestations_total INT NOT NULL DEFAULT 0; | ||
ALTER TABLE validator_stats ADD COLUMN IF NOT EXISTS proposed_blocks_total INT NOT NULL DEFAULT 0; | ||
ALTER TABLE validator_stats ADD COLUMN IF NOT EXISTS missed_blocks_total INT NOT NULL DEFAULT 0; | ||
ALTER TABLE validator_stats ADD COLUMN IF NOT EXISTS orphaned_blocks_total INT NOT NULL DEFAULT 0; | ||
ALTER TABLE validator_stats ADD COLUMN IF NOT EXISTS attester_slashings_total INT NOT NULL DEFAULT 0; | ||
ALTER TABLE validator_stats ADD COLUMN IF NOT EXISTS proposer_slashings_total INT NOT NULL DEFAULT 0; | ||
ALTER TABLE validator_stats ADD COLUMN IF NOT EXISTS participated_sync_total INT NOT NULL DEFAULT 0; | ||
ALTER TABLE validator_stats ADD COLUMN IF NOT EXISTS missed_sync_total INT NOT NULL DEFAULT 0; | ||
ALTER TABLE validator_stats ADD COLUMN IF NOT EXISTS orphaned_sync_total INT NOT NULL DEFAULT 0; | ||
ALTER TABLE validator_stats ADD COLUMN IF NOT EXISTS withdrawals_total INT NOT NULL DEFAULT 0; | ||
ALTER TABLE validator_stats ADD COLUMN IF NOT EXISTS withdrawals_amount_total BIGINT NOT NULL DEFAULT 0; | ||
ALTER TABLE validator_stats ADD COLUMN IF NOT EXISTS el_rewards_wei_total BIGINT NOT NULL DEFAULT 0; | ||
ALTER TABLE validator_stats ADD COLUMN IF NOT EXISTS cl_rewards_gwei_total BIGINT NOT NULL DEFAULT 0; | ||
ALTER TABLE validator_stats ADD COLUMN IF NOT EXISTS mev_rewards_wei_total BIGINT NOT NULL DEFAULT 0; | ||
ALTER TABLE validator_stats ADD COLUMN IF NOT EXISTS deposits_total INT NOT NULL DEFAULT 0; | ||
ALTER TABLE validator_stats ADD COLUMN IF NOT EXISTS deposits_amount_total BIGINT NOT NULL DEFAULT 0; | ||
|
||
CREATE TABLE IF NOT EXISTS | ||
validator_stats_totals ( | ||
validatorindex INT NOT NULL, | ||
missed_attestations INT NOT NULL, | ||
orphaned_attestations INT NOT NULL, | ||
proposed_blocks INT NOT NULL, | ||
missed_blocks INT NOT NULL, | ||
orphaned_blocks INT NOT NULL, | ||
attester_slashings INT NOT NULL, | ||
proposer_slashings INT NOT NULL, | ||
participated_sync INT NOT NULL, | ||
missed_sync INT NOT NULL, | ||
orphaned_sync INT NOT NULL, | ||
withdrawals INT NOT NULL, | ||
withdrawals_amount BIGINT NOT NULL, | ||
el_rewards_wei BIGINT NOT NULL, | ||
cl_rewards_gwei BIGINT NOT NULL, | ||
mev_rewards_wei BIGINT NOT NULL, | ||
deposits INT NOT NULL, | ||
deposits_amount BIGINT NOT NULL, | ||
PRIMARY KEY (validatorindex) | ||
); | ||
-- +goose StatementEnd | ||
|
||
-- +goose Down | ||
|
||
-- +goose StatementBegin | ||
-- existed before: missed_attestations_total, participated_sync_total, missed_sync_total, orphaned_sync_total, el_rewards_wei_total, cl_rewards_gwei_total, mev_rewards_wei_total | ||
DROP TABLE IF EXISTS validator_stats_totals; | ||
--ALTER TABLE validator_stats DROP COLUMN IF EXISTS missed_attestations_total; | ||
ALTER TABLE validator_stats DROP COLUMN IF EXISTS orphaned_attestations_total; | ||
ALTER TABLE validator_stats DROP COLUMN IF EXISTS proposed_blocks_total; | ||
ALTER TABLE validator_stats DROP COLUMN IF EXISTS missed_blocks_total; | ||
ALTER TABLE validator_stats DROP COLUMN IF EXISTS orphaned_blocks_total; | ||
ALTER TABLE validator_stats DROP COLUMN IF EXISTS attester_slashings_total; | ||
ALTER TABLE validator_stats DROP COLUMN IF EXISTS proposer_slashings_total; | ||
--ALTER TABLE validator_stats DROP COLUMN IF EXISTS participated_sync_total; | ||
--ALTER TABLE validator_stats DROP COLUMN IF EXISTS missed_sync_total; | ||
--ALTER TABLE validator_stats DROP COLUMN IF EXISTS orphaned_sync_total; | ||
ALTER TABLE validator_stats DROP COLUMN IF EXISTS withdrawals_total; | ||
ALTER TABLE validator_stats DROP COLUMN IF EXISTS withdrawals_amount_total; | ||
--ALTER TABLE validator_stats DROP COLUMN IF EXISTS el_rewards_wei_total; | ||
--ALTER TABLE validator_stats DROP COLUMN IF EXISTS cl_rewards_gwei_total; | ||
--ALTER TABLE validator_stats DROP COLUMN IF EXISTS mev_rewards_wei_total; | ||
ALTER TABLE validator_stats DROP COLUMN IF EXISTS deposits_total; | ||
ALTER TABLE validator_stats DROP COLUMN IF EXISTS deposits_amount_total; | ||
-- +goose StatementEnd |
Oops, something went wrong.