alter table report_summary 
    add column if not exists customers jsonb, 
    add column if not exists publics jsonb,
    add column if not exists diluteds jsonb;

update report_summary
set 
    customers = jsonb_build_object(
        'consumption', customer_consumption,
        'fee', customer_consumption_fee,
        'critical', customer_consumption_critical,
        'criticalFee', customer_consumption_critical_fee,
        'peak', customer_consumption_peak,
        'peakFee', customer_consumption_peak_fee,
        'flat', customer_consumption_flat,
        'flatFee', customer_consumption_flat_fee,
        'valley', customer_consumption_valley,
        'valleyFee', customer_consumption_valley_fee,
        'proportion', null
    ),
    publics = jsonb_build_object(
        'consumption', public_consumption,
        'fee', public_consumption_fee,
        'critical', public_consumption_critical,
        'criticalFee', public_consumption_critical_fee,
        'peak', public_consumption_peak,
        'peakFee', public_consumption_peak_fee,
        'flat', public_consumption_flat,
        'flatFee', public_consumption_flat_fee,
        'valley', public_consumption_valley,
        'valleyFee', public_consumption_valley_fee,
        'proportion', public_consumption_proportion
    ),
    diluteds = jsonb_build_object(
        'consumption', null,
        'fee', null,
        'critical', null,
        'criticalFee', null,
        'peak', null,
        'peakFee', null,
        'flat', null,
        'flatFee', null,
        'valley', null,
        'valleyFee', null,
        'proportion', null
    );