{"action":"closed","issue":{"url":"https://api.github.com/repos/klpdotorg/dubdubdub/issues/385","labels_url":"https://api.github.com/repos/klpdotorg/dubdubdub/issues/385/labels{/name}","comments_url":"https://api.github.com/repos/klpdotorg/dubdubdub/issues/385/comments","events_url":"https://api.github.com/repos/klpdotorg/dubdubdub/issues/385/events","html_url":"https://github.com/klpdotorg/dubdubdub/issues/385","id":53720315,"number":385,"title":"Fix Primary Key issue for tables before new data imports","user":{"login":"batpad","id":72280,"avatar_url":"https://avatars.githubusercontent.com/u/72280?v=3","gravatar_id":"","url":"https://api.github.com/users/batpad","html_url":"https://github.com/batpad","followers_url":"https://api.github.com/users/batpad/followers","following_url":"https://api.github.com/users/batpad/following{/other_user}","gists_url":"https://api.github.com/users/batpad/gists{/gist_id}","starred_url":"https://api.github.com/users/batpad/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/batpad/subscriptions","organizations_url":"https://api.github.com/users/batpad/orgs","repos_url":"https://api.github.com/users/batpad/repos","events_url":"https://api.github.com/users/batpad/events{/privacy}","received_events_url":"https://api.github.com/users/batpad/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":{"login":"iambibhas","id":357253,"avatar_url":"https://avatars.githubusercontent.com/u/357253?v=3","gravatar_id":"","url":"https://api.github.com/users/iambibhas","html_url":"https://github.com/iambibhas","followers_url":"https://api.github.com/users/iambibhas/followers","following_url":"https://api.github.com/users/iambibhas/following{/other_user}","gists_url":"https://api.github.com/users/iambibhas/gists{/gist_id}","starred_url":"https://api.github.com/users/iambibhas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/iambibhas/subscriptions","organizations_url":"https://api.github.com/users/iambibhas/orgs","repos_url":"https://api.github.com/users/iambibhas/repos","events_url":"https://api.github.com/users/iambibhas/events{/privacy}","received_events_url":"https://api.github.com/users/iambibhas/received_events","type":"User","site_admin":false},"milestone":null,"comments":2,"created_at":"2015-01-08T06:47:39Z","updated_at":"2015-05-19T10:45:17Z","closed_at":"2015-05-19T10:45:17Z","body":"There are a few tables where we forced a primary key to make django happy. Once we do yearly data, these columns will no longer be unique and need to be fixed.\r\n\r\nProposed solution:\r\n\r\n - Create new table with the same schema, adding an auto-increment primary key.\r\n - Copy data from old table to new table.\r\n - Change references in code to use new table.\r\n - Delete old table\r\n\r\n@iambibhas does that sound about right? Can you add in what all tables this needs to be done for?"}}