Sort migrations before running.