defined foreign keys and relationships for the stops and scans on on and off on pairs table