migration script should also include this code to remove workaround:
update web_appointment set visit_id = null where visit_id in (select id from web_visit where subject_id in (select id from web_subject where screening_number='---'));delete from web_visit where subject_id in (select id from web_subject where screening_number='---');delete from web_subject where screening_number='---';