-- +goose DisableTransaction
-- +goose Up
-- SQL in section 'Up' is executed when this migration is applied
-- IF NOT EXISTS allows to run queries manually
-- CONCURRENTLY doesn't lock table, so it's safe to run on production without downtime
CREATE INDEX CONCURRENTLY
IF NOT EXISTS journey_last_miles_tracking_number_index
ON journey_last_miles (tracking_number);
-- +goose Down
-- SQL section 'Down' is executed when this migration is rolled back
DROP INDEX journey_last_miles_tracking_number_index;
We have migration with
CREATE INDEX CONCURRENTLY. It can't be done in transaction.Will you be welcome for pull request similar to this commit? smacker@a56fc24
Migration example: