You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
SELECT PlayerRoute, COUNT(PlayerId) FROM StoolballPlayer GROUP BY PlayerRoute HAVING COUNT(PlayerId) > 1 returns the affected players.
This was already the case before the implementation of #615
Affected player identities are the same name and the same team, which should have matched the existing identity. The following query shows the players who were affected, even after the fix below:
SELECT PlayerIdentityName, COUNT(PlayerIdentityId) FROM StoolballPlayerIdentity GROUP BY PlayerIdentityName, TeamId HAVING COUNT(PlayerIdentityId) > 1
Many are players with no statistics, which would not be there if #555 was completed, so #555 might solve this. However statistics are not used in matching an existing identity, so this doesn't explain why they weren't matched.
Script used to fix the affected players:
DECLARE @playerId uniqueidentifier, @duplicatedRoute nvarchar(255), @revisedRoute nvarchar(255)
SET @duplicatedRoute = '/players/affected-name'
SET @revisedRoute = '/players/affected-name-1'
-- Find a new route that works
SELECT PlayerId FROM StoolballPlayer WHERE PlayerRoute = @revisedRoute
IF @@ROWCOUNT = 0
BEGIN
-- Apply new route
PRINT 'New route is unused. Applying.'
BEGIN TRAN
SELECT TOP 1 @playerId = PlayerId FROM StoolballPlayer WHERE PlayerRoute = @duplicatedRoute
UPDATE StoolballPlayer SET PlayerRoute = @revisedRoute WHERE PlayerId = @playerId
UPDATE StoolballPlayerInMatchStatistics SET PlayerRoute = @revisedRoute WHERE PlayerId = @playerId
COMMIT TRAN
END
ELSE
PRINT 'New route in use. Try another.'
The text was updated successfully, but these errors were encountered:
SELECT PlayerRoute, COUNT(PlayerId) FROM StoolballPlayer GROUP BY PlayerRoute HAVING COUNT(PlayerId) > 1
returns the affected players.This was already the case before the implementation of #615
Affected player identities are the same name and the same team, which should have matched the existing identity. The following query shows the players who were affected, even after the fix below:
SELECT PlayerIdentityName, COUNT(PlayerIdentityId) FROM StoolballPlayerIdentity GROUP BY PlayerIdentityName, TeamId HAVING COUNT(PlayerIdentityId) > 1
Many are players with no statistics, which would not be there if #555 was completed, so #555 might solve this. However statistics are not used in matching an existing identity, so this doesn't explain why they weren't matched.
Script used to fix the affected players:
The text was updated successfully, but these errors were encountered: