Skip to content

Open source, composable payments platform | PCI compliant | SaaS and Self-host options | Enables connectivity to multiple payment, payout, fraud, vault and tokenization providers | Uplifts authorization with intelligent routing and revenue recovery | Reduce payment processing costs with cost observability | Reduces payment ops with reconciliation

502 B
Raw Blame
-- Your SQL goes here

-- This migration backfills the organization_id column in the payouts table.
-- It sets organization_id based on the corresponding merchant_account entry for cases where the organization_id was NULL.
-- This is required for older payout records created before organization_id was introduced as a column in the payouts table.

UPDATE payouts p
SET organization_id = ma.organization_id
FROM merchant_account ma
WHERE p.merchant_id = ma.merchant_id
  AND p.organization_id IS NULL;