Bulk linking players via sql
I have a list of players each with multiple screen names across different sites, that I want to link together for combined HUD/report stats. I've confirmed the standard aliasing process (View Stats > alias icon > add screen names) works perfectly for combining stats.
Doing this one at a time through the UI for 50+ people is going to take a while, so I tried replicating it directly via SQL (pgAdmin) instead -- specifically, updating the id_player_alias column on the player table to point secondary accounts at a main account's id_player, matching the pattern I see on my own already-aliased accounts. I then ran Database > Housekeeping > Rebuild Cache.
This did NOT work -- Reports and HUD stats only showed hands/ stats for the "main account", even though the Player list showed them as "aliased." When I instead linked the same two accounts through the normal UI process, it worked immediately and correctly.
So there's clearly something the UI does beyond setting id_player_alias that I'm missing. I noticed tourney_hand_player_statistics has both an id_player and an id_player_real column -- is the UI backfilling id_player_real on existing hand rows when you add an alias? Is there a specific stored procedure or internal process I could call directly to replicate this for many players at once, rather than doing it manually one at a time?
Backed up my database before any of this, all confirmed-working parts were done through the standard aliasing UI. Just trying to find a faster path for linking a large batch of players. Appreciate any insight!
Doing this one at a time through the UI for 50+ people is going to take a while, so I tried replicating it directly via SQL (pgAdmin) instead -- specifically, updating the id_player_alias column on the player table to point secondary accounts at a main account's id_player, matching the pattern I see on my own already-aliased accounts. I then ran Database > Housekeeping > Rebuild Cache.
This did NOT work -- Reports and HUD stats only showed hands/ stats for the "main account", even though the Player list showed them as "aliased." When I instead linked the same two accounts through the normal UI process, it worked immediately and correctly.
So there's clearly something the UI does beyond setting id_player_alias that I'm missing. I noticed tourney_hand_player_statistics has both an id_player and an id_player_real column -- is the UI backfilling id_player_real on existing hand rows when you add an alias? Is there a specific stored procedure or internal process I could call directly to replicate this for many players at once, rather than doing it manually one at a time?
Backed up my database before any of this, all confirmed-working parts were done through the standard aliasing UI. Just trying to find a faster path for linking a large batch of players. Appreciate any insight!
