Move migration clash detection to a better location