select
    case
        when count(*) = 0 then 'Success. No data lost in migration'
        else 'Fail. ' || count(*) || ' rows lost in migration'
    end as test_result
from
(
    select
        policy_id,
        person_id,
        first_notification_of_loss,
        date_and_time_of_incident,
        police_reference,
        photos_to_follow,
        sketch_to_follow,
        description_of_weather,
        description_of_incident,
        description_of_property_damage
    from
        old_claim
    except
    select
        a.policy_id,
        a.person_id,
        a.first_notification_of_loss,
        b.occurred_at                  as date_and_time_of_incident,
        a.police_reference,
        a.photos_to_follow,
        a.sketch_to_follow,
        a.description_of_weather,
        b.description                  as description_of_incident,
        a.description_of_property_damage
    from
        claim a
        left outer join
        incident b
        on a.incident_id = b.id
) x;
