Skip to content

Commit e0324b7

Browse files
committed
feat(migrations): part 2 of dashboard exporter backfill process
1 parent d09b63c commit e0324b7

File tree

2 files changed

+26
-0
lines changed

2 files changed

+26
-0
lines changed
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
-- +goose Up
2+
-- +goose StatementBegin
3+
-- +goose ENVSUB ON
4+
ALTER TABLE _final_validator_dashboard_data_epoch
5+
UPDATE
6+
withdrawals_count = withdrawals_count + dictGet(_dict_backfill_electra_fork_epoch_events, 'withdrawals_count', (epoch_timestamp, validator_index)),
7+
withdrawals_amount = withdrawals_amount + dictGet(_dict_backfill_electra_fork_epoch_events, 'withdrawals_amount', (epoch_timestamp, validator_index))
8+
where epoch_timestamp = ${ELECTRA_FORK_EPOCH_TIMESTAMP?please set to the epoch timestamp AFTER the dashboard exporter has prepared the dictionary. set to random date if backfill is not required (i.e the overall export was started after this fix was added)} settings alter_sync=2, mutations_sync=2, database_replicated_enforce_synchronous_settings=1;
9+
-- +goose ENVSUB OFF
10+
-- +goose StatementEnd
11+
12+
-- +goose Down
13+
-- +goose StatementBegin
14+
-- purposefully fail
15+
select * from "downgrade not supported"."manual re-export recommended"
16+
-- +goose StatementEnd
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
-- +goose Up
2+
-- +goose StatementBegin
3+
ALTER TABLE _final_validator_dashboard_data_epoch
4+
MATERIALIZE COLUMN roi_dividend settings alter_sync=0;
5+
-- +goose StatementEnd
6+
7+
-- +goose Down
8+
-- +goose StatementBegin
9+
10+
-- +goose StatementEnd

0 commit comments

Comments
 (0)