-- v0.701: Add retry columns for TransferRetryWorker
ALTER TABLE seller_transfers
    ADD COLUMN IF NOT EXISTS retry_count INTEGER NOT NULL DEFAULT 0,
    ADD COLUMN IF NOT EXISTS next_retry_at TIMESTAMPTZ;

CREATE INDEX IF NOT EXISTS idx_seller_transfers_retry
    ON seller_transfers(status, next_retry_at)
    WHERE status = 'failed' AND next_retry_at IS NOT NULL;
