Skip to content

Commit

Permalink
fix(migrations): add no tx statement for concurrent migration
Browse files Browse the repository at this point in the history
  • Loading branch information
guybrush committed Dec 9, 2024
1 parent 37577c2 commit a8deb05
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@ ALTER TABLE users_val_dashboards_groups ADD COLUMN IF NOT EXISTS webhook_retries
-- +goose Down
-- +goose StatementBegin
SELECT 'remove columns from table users_val_dashboards_groups';
ALTER TABLE users_val_dashboards_groups DROP COLUMN IF NOT EXISTS webhook_last_sent;
ALTER TABLE users_val_dashboards_groups DROP COLUMN IF NOT EXISTS webhook_retries;
ALTER TABLE users_val_dashboards_groups DROP COLUMN IF EXISTS webhook_last_sent;
ALTER TABLE users_val_dashboards_groups DROP COLUMN IF EXISTS webhook_retries;
-- +goose StatementEnd
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
-- +goose NO TRANSACTION

-- +goose Up
-- +goose StatementBegin
SELECT 'creating idx_blocks_withdrawals_validatorindex_slot';
-- +goose StatementBegin
CREATE INDEX CONCURRENTLY IF NOT EXISTS idx_blocks_withdrawals_validatorindex_slot ON blocks_withdrawals (validatorindex, block_slot DESC);
-- +goose StatementEnd

-- +goose Down
-- +goose StatementBegin
SELECT 'dropping idx_blocks_withdrawals_validatorindex_slot';
-- +goose StatementBegin
DROP INDEX CONCURRENTLY IF EXISTS idx_blocks_withdrawals_validatorindex_slot;
-- +goose StatementEnd
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ CREATE TABLE IF NOT EXISTS rocketpool_onchain_configs (
PRIMARY KEY (rocketpool_storage_address)
);

ALTER TABLE rocketpool_minipools ADD COLUMN validator_index INTEGER;
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
Expand All @@ -18,6 +18,6 @@ CREATE INDEX IF NOT EXISTS rocketpool_minipools_validator_index_idx ON rocketpoo
DROP TABLE IF EXISTS rocketpool_onchain_configs;

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

-- +goose StatementEnd

0 comments on commit a8deb05

Please sign in to comment.