diff --git a/backend/pkg/commons/db/migrations/postgres/20241104132640_add_columns_to_users_val_dashboards_groups.sql b/backend/pkg/commons/db/migrations/postgres/20241104132640_add_columns_to_users_val_dashboards_groups.sql index 4e05100cf..b6b1af5b9 100644 --- a/backend/pkg/commons/db/migrations/postgres/20241104132640_add_columns_to_users_val_dashboards_groups.sql +++ b/backend/pkg/commons/db/migrations/postgres/20241104132640_add_columns_to_users_val_dashboards_groups.sql @@ -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 diff --git a/backend/pkg/commons/db/migrations/postgres/20241120092635_add_validatorindex_slot_index_withdrawals_table.sql b/backend/pkg/commons/db/migrations/postgres/20241120092635_add_validatorindex_slot_index_withdrawals_table.sql index 5bafa95f2..5bc3eb099 100644 --- a/backend/pkg/commons/db/migrations/postgres/20241120092635_add_validatorindex_slot_index_withdrawals_table.sql +++ b/backend/pkg/commons/db/migrations/postgres/20241120092635_add_validatorindex_slot_index_withdrawals_table.sql @@ -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 diff --git a/backend/pkg/commons/db/migrations/postgres/20241121094954_rocketpool_onchain_configs.sql b/backend/pkg/commons/db/migrations/postgres/20241121094954_rocketpool_onchain_configs.sql index f42c495a2..334540e3d 100644 --- a/backend/pkg/commons/db/migrations/postgres/20241121094954_rocketpool_onchain_configs.sql +++ b/backend/pkg/commons/db/migrations/postgres/20241121094954_rocketpool_onchain_configs.sql @@ -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 @@ -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