-- When an organization is deleted, cascade delete related data. -- Order: clean up orders (and their dependents), then customers, vendors, unlink users. LEFT JOIN customers c ON o.customer_id = c.id ...
DROP POLICY IF EXISTS "Admins can view invitations in their org" ON public.organization_invitations; CREATE POLICY "Admins can view invitations in their org" ON public.organization_invitations FOR ...