{"action":"closed","issue":{"url":"https://api.github.com/repos/NemeStats/NemeStats/issues/520","repository_url":"https://api.github.com/repos/NemeStats/NemeStats","labels_url":"https://api.github.com/repos/NemeStats/NemeStats/issues/520/labels{/name}","comments_url":"https://api.github.com/repos/NemeStats/NemeStats/issues/520/comments","events_url":"https://api.github.com/repos/NemeStats/NemeStats/issues/520/events","html_url":"https://github.com/NemeStats/NemeStats/issues/520","id":186692797,"number":520,"title":"Tons of duplicate BoardGameGeekGameCategory Records Getting Created","user":{"login":"jakejgordon","id":3045786,"avatar_url":"https://avatars.githubusercontent.com/u/3045786?v=3","gravatar_id":"","url":"https://api.github.com/users/jakejgordon","html_url":"https://github.com/jakejgordon","followers_url":"https://api.github.com/users/jakejgordon/followers","following_url":"https://api.github.com/users/jakejgordon/following{/other_user}","gists_url":"https://api.github.com/users/jakejgordon/gists{/gist_id}","starred_url":"https://api.github.com/users/jakejgordon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jakejgordon/subscriptions","organizations_url":"https://api.github.com/users/jakejgordon/orgs","repos_url":"https://api.github.com/users/jakejgordon/repos","events_url":"https://api.github.com/users/jakejgordon/events{/privacy}","received_events_url":"https://api.github.com/users/jakejgordon/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":{"login":"vfportero","id":1107782,"avatar_url":"https://avatars.githubusercontent.com/u/1107782?v=3","gravatar_id":"","url":"https://api.github.com/users/vfportero","html_url":"https://github.com/vfportero","followers_url":"https://api.github.com/users/vfportero/followers","following_url":"https://api.github.com/users/vfportero/following{/other_user}","gists_url":"https://api.github.com/users/vfportero/gists{/gist_id}","starred_url":"https://api.github.com/users/vfportero/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vfportero/subscriptions","organizations_url":"https://api.github.com/users/vfportero/orgs","repos_url":"https://api.github.com/users/vfportero/repos","events_url":"https://api.github.com/users/vfportero/events{/privacy}","received_events_url":"https://api.github.com/users/vfportero/received_events","type":"User","site_admin":false},"assignees":[{"login":"vfportero","id":1107782,"avatar_url":"https://avatars.githubusercontent.com/u/1107782?v=3","gravatar_id":"","url":"https://api.github.com/users/vfportero","html_url":"https://github.com/vfportero","followers_url":"https://api.github.com/users/vfportero/followers","following_url":"https://api.github.com/users/vfportero/following{/other_user}","gists_url":"https://api.github.com/users/vfportero/gists{/gist_id}","starred_url":"https://api.github.com/users/vfportero/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vfportero/subscriptions","organizations_url":"https://api.github.com/users/vfportero/orgs","repos_url":"https://api.github.com/users/vfportero/repos","events_url":"https://api.github.com/users/vfportero/events{/privacy}","received_events_url":"https://api.github.com/users/vfportero/received_events","type":"User","site_admin":false}],"milestone":null,"comments":1,"created_at":"2016-11-02T01:47:57Z","updated_at":"2016-11-03T17:29:10Z","closed_at":"2016-11-03T17:29:10Z","body":"Run the SQL query against a fairly recent instance of the production database and you'll see over 2,300 total records -- almost all of them duplicates.\r\n\r\nSELECT [Id]\r\n      ,[BoardGameGeekGameCategoryId]\r\n      ,[CategoryName]\r\n  FROM [NerdScorekeeper].[dbo].[BoardGameGeekGameCategory]\r\n  ORDER BY BoardGameGeekGameCategoryId\r\n\r\nWe need to:\r\n1. Add a unique constraint on BoardGameGeekGameCategoryId as well as another unique constraint on CategoryName (via attributes on the BusinessLogic model)\r\n2. Add a migration to consolidate all references to this table to the single (oldest/original) id for the BoardGameGeekGameCategoryId and delete the duplicate records (via sql -- not code)"}}
{"actor":{"display_login":"vfportero"}}