Most people have found that sowing carrots near onions does not work consistently to deter carrot root fly. The incidence of carrot root fly on my carrots this year has been much less than last year. It could easily be a coincidence, but if it works for you two years in a row, please let us all know. Horticultural fleece though expensive is a much more reliable solution and carrot seed itself is very cheap.