mirror of
https://github.com/juspay/hyperswitch.git
synced 2025-12-05 18:46:43 -06:00
feat(psql): Backfill payouts table where organization_id is null (#10210)
Co-authored-by: Sayak Bhattacharya <sayak.b@Sayak-Bhattacharya-G092THXJ34.local>
This commit is contained in:
committed by
GitHub
parent
2964d043d8
commit
3cbc98c050
@@ -0,0 +1,3 @@
|
||||
-- This file should undo anything in `up.sql`
|
||||
|
||||
SELECT 1;
|
||||
@@ -0,0 +1,11 @@
|
||||
-- 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;
|
||||
Reference in New Issue
Block a user