-- Migration: Clean up Payroll module - remove duplicate Export button
-- Date: 2025-11-20
-- Description: Remove the duplicate "Export" button from Payroll module, keeping only "Export Excel"

UPDATE modules 
SET config = jsonb_set(
    config,
    '{header}',
    (
        SELECT jsonb_agg(item)
        FROM jsonb_array_elements(config->'header') item
        WHERE NOT (item->>'label' = 'Export' AND item->>'onClick' = 'showExportDialog')
    )
)
WHERE module_id = '018e3f0a-12d3-7c45-b89a-2f3c4e1d5b6c'::uuid
AND name = 'Payroll';
