INSERT INTO public.thx (
    application_key,
    application_timestamp,
    digital_id_first_seen,
    summary_risk_score,
    cpu_clock,
    true_ip_first_seen,
    ssn_hash_first_seen,
    account_email_attributes,
    tps_ip_latitude,
    tps_ip_longitude,
    account_telephone_first_seen,
    account_login_first_seen
)
VALUES (
    $application_key,
    $application_timestamp,
    $digital_id_first_seen,
    $summary_risk_score,
    $cpu_clock,
    $true_ip_first_seen,
    $ssn_hash_first_seen,
    $account_email_attributes,
    $tps_ip_latitude,
    $tps_ip_longitude,
    $account_telephone_first_seen,
    $account_login_first_seen
)
ON CONFLICT (application_key)
DO UPDATE
    SET application_timestamp          = EXCLUDED.application_timestamp,
        digital_id_first_seen          = EXCLUDED.digital_id_first_seen,
        summary_risk_score             = EXCLUDED.summary_risk_score,
        cpu_clock                      = EXCLUDED.cpu_clock,
        true_ip_first_seen             = EXCLUDED.true_ip_first_seen,
        ssn_hash_first_seen            = EXCLUDED.ssn_hash_first_seen,
        account_email_attributes       = EXCLUDED.account_email_attributes,
        tps_ip_latitude                = EXCLUDED.tps_ip_latitude,
        tps_ip_longitude               = EXCLUDED.tps_ip_longitude,
        account_telephone_first_seen   = EXCLUDED.account_telephone_first_seen,
        account_login_first_seen       = EXCLUDED.account_login_first_seen;

