Added correct sorting for migrations