From 9de41df07b556600c82f53dde2da393ae6c1fe72 Mon Sep 17 00:00:00 2001 From: Patrick Pfeiffer <306324+guybrush@users.noreply.github.com> Date: Mon, 13 Jan 2025 10:59:09 +0100 Subject: [PATCH] fix: fix migrations for goose to run concurrently --- .../20250112125552_add_idx_blocks_status_depositscountgt0.sql | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/backend/pkg/commons/db/migrations/postgres/20250112125552_add_idx_blocks_status_depositscountgt0.sql b/backend/pkg/commons/db/migrations/postgres/20250112125552_add_idx_blocks_status_depositscountgt0.sql index 726f7747e..b51adc9c2 100644 --- a/backend/pkg/commons/db/migrations/postgres/20250112125552_add_idx_blocks_status_depositscountgt0.sql +++ b/backend/pkg/commons/db/migrations/postgres/20250112125552_add_idx_blocks_status_depositscountgt0.sql @@ -1,13 +1,13 @@ -- +goose NO TRANSACTION -- +goose Up --- +goose StatementBegin SELECT 'creating idx_blocks_status_depositscountgt0'; +-- +goose StatementBegin CREATE INDEX CONCURRENTLY IF NOT EXISTS idx_blocks_status_depositscountgt0 ON blocks (status, (depositscount > 0)) where depositscount > 0; -- +goose StatementEnd -- +goose Down --- +goose StatementBegin SELECT 'dropping idx_blocks_status_depositscountgt0'; +-- +goose StatementBegin DROP INDEX CONCURRENTLY IF EXISTS idx_blocks_status_depositscountgt0; -- +goose StatementEnd