def update_umpire_ids_for_games
        ump_id_hp = nil
        ump_id_1b = nil
        ump_id_2b = nil
        ump_id_3b = nil
        res = @db.query("select id, umpire_hp_id, umpire_1b_id, umpire_2b_id, umpire_3b_id from games")
        res.each do |row| # each game
          game_id = row[0]
          umpire_hp_id = row['umpire_hp_id']
          umpire_1b_id = row['umpire_1b_id']
          umpire_2b_id = row['umpire_2b_id']
          umpire_3b_id = row['umpire_3b_id']
        
          # look up umpire record for hp ump
          ump_id_hp = get_first_occurance_of_umpire(umpire_hp_id)
          ump_id_1b = get_first_occurance_of_umpire(umpire_1b_id)
          ump_id_2b = get_first_occurance_of_umpire(umpire_2b_id)
          ump_id_3b = get_first_occurance_of_umpire(umpire_3b_id)
        
          # update game with correct ump ids
          @db.query("UPDATE games SET umpire_hp_id='#{ump_id_hp}',umpire_1b_id='#{ump_id_1b}',
                       umpire_2b_id='#{ump_id_2b}', umpire_3b_id='#{ump_id_3b}' WHERE id=#{game_id}")
        end
      end
def update_umpire_ids_for_games
        ump_id_hp = nil
        ump_id_1b = nil
        ump_id_2b = nil
        ump_id_3b = nil
        res = @db.query("select id, umpire_hp_id, umpire_1b_id, umpire_2b_id, umpire_3b_id from games")
        res.each do |row| # each game
          game_id = row[0]
          umpire_hp_id = row['umpire_hp_id']
          umpire_1b_id = row['umpire_1b_id']
          umpire_2b_id = row['umpire_2b_id']
          umpire_3b_id = row['umpire_3b_id']
        
          # look up umpire record for hp ump
          ump_id_hp = get_first_occurance_of_umpire(umpire_hp_id)
          ump_id_1b = get_first_occurance_of_umpire(umpire_1b_id)
          ump_id_2b = get_first_occurance_of_umpire(umpire_2b_id)
          ump_id_3b = get_first_occurance_of_umpire(umpire_3b_id)
        
          # update game with correct ump ids
          @db.query("UPDATE games SET umpire_hp_id='#{ump_id_hp}',umpire_1b_id='#{ump_id_1b}',
                       umpire_2b_id='#{ump_id_2b}', umpire_3b_id='#{ump_id_3b}' WHERE id=#{game_id}")
        end
      end
Update the game records to point to the first instance of the specific umpires
 originally new umpire records were being inserted for every game, which is what caused this problem