code: func sortMigrations(dir MigrationDirection, migrations []Migration) []Migration {
  	var m ByID
  	for _, migration := range migrations {
  		m = append(m, migration)
  	}
  
  	switch dir {
  	case Up:
  		sort.Sort(ByID(m))
  	default:
  		sort.Sort(sort.Reverse(ByID(m)))
  	}
  
  	return m
  }
docs: // sortMigrations sorts the migrations by id.
  //
  // When the direction is "Up", the migrations will be sorted by ID ascending.
  // When the direction is "Down", the migrations will be sorted by ID descending.