Skip to content

Commit

Permalink
chore(db): update db-migration-files (#2996)
Browse files Browse the repository at this point in the history
Co-authored-by: Patrick Pfeiffer <[email protected]>
  • Loading branch information
guybrush and guybrush authored Jan 13, 2025
1 parent 711bef3 commit 1af1273
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 0 deletions.
23 changes: 23 additions & 0 deletions db/migrations/20241121094954_rocketpool_onchain_configs.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
-- +goose Up
-- +goose StatementBegin

CREATE TABLE IF NOT EXISTS rocketpool_onchain_configs (
rocketpool_storage_address bytea NOT NULL,
smoothing_pool_address bytea NOT NULL,
PRIMARY KEY (rocketpool_storage_address)
);

ALTER TABLE rocketpool_minipools ADD COLUMN IF NOT EXISTS validator_index INTEGER;
CREATE INDEX IF NOT EXISTS rocketpool_minipools_validator_index_idx ON rocketpool_minipools (validator_index);

-- +goose StatementEnd

-- +goose Down
-- +goose StatementBegin

DROP TABLE IF EXISTS rocketpool_onchain_configs;

DROP INDEX IF EXISTS rocketpool_minipools_validator_index_idx;
ALTER TABLE rocketpool_minipools DROP COLUMN IF EXISTS validator_index;

-- +goose StatementEnd
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 1af1273

Please sign in to comment.