From 4dbe124959dbfe70497e377d3c5f313bacd63190 Mon Sep 17 00:00:00 2001 From: invis-bitfly <162128378+invis-bitfly@users.noreply.github.com> Date: Thu, 9 Jan 2025 14:49:04 +0100 Subject: [PATCH] feat(migrations): add finalized el rewards table --- ..._add_finalized_execution_rewards_table.sql | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 backend/pkg/commons/db/migrations/postgres/20250109144744_add_finalized_execution_rewards_table.sql diff --git a/backend/pkg/commons/db/migrations/postgres/20250109144744_add_finalized_execution_rewards_table.sql b/backend/pkg/commons/db/migrations/postgres/20250109144744_add_finalized_execution_rewards_table.sql new file mode 100644 index 000000000..4e48f83c7 --- /dev/null +++ b/backend/pkg/commons/db/migrations/postgres/20250109144744_add_finalized_execution_rewards_table.sql @@ -0,0 +1,21 @@ +-- +goose Up +-- +goose StatementBegin +CREATE TABLE execution_rewards_finalized ( + epoch int4 NOT NULL, + slot int4 NOT NULL, + proposer int4 NOT NULL, + value numeric NOT NULL, + CONSTRAINT finalized_execution_rewards_pk PRIMARY KEY (slot) +); +-- +goose StatementEnd +-- +goose StatementBegin +CREATE INDEX finalized_execution_rewards_epoch_idx ON execution_rewards_finalized USING btree (epoch); +-- +goose StatementEnd +-- +goose StatementBegin +CREATE UNIQUE INDEX finalized_execution_rewards_proposer_idx ON execution_rewards_finalized USING btree (proposer, slot); +-- +goose StatementEnd + +-- +goose Down +-- +goose StatementBegin +DROP TABLE execution_rewards_finalized; +-- +goose StatementEnd