-- +goose Up ALTER TABLE attachments ADD COLUMN processing_started_at timestamptz; CREATE INDEX attachments_unfinished ON attachments(status) WHERE status IN ('queued','processing'); -- +goose Down DROP INDEX attachments_unfinished; ALTER TABLE attachments DROP COLUMN processing_started_at;