{"action":"created","issue":{"url":"https://api.github.com/repos/DoSomething/northstar/issues/342","repository_url":"https://api.github.com/repos/DoSomething/northstar","labels_url":"https://api.github.com/repos/DoSomething/northstar/issues/342/labels{/name}","comments_url":"https://api.github.com/repos/DoSomething/northstar/issues/342/comments","events_url":"https://api.github.com/repos/DoSomething/northstar/issues/342/events","html_url":"https://github.com/DoSomething/northstar/pull/342","id":149535648,"number":342,"title":"Un-revert the reverted migration commits. :arrows_counterclockwise:","user":{"login":"DFurnes","id":583202,"avatar_url":"https://avatars.githubusercontent.com/u/583202?v=3","gravatar_id":"","url":"https://api.github.com/users/DFurnes","html_url":"https://github.com/DFurnes","followers_url":"https://api.github.com/users/DFurnes/followers","following_url":"https://api.github.com/users/DFurnes/following{/other_user}","gists_url":"https://api.github.com/users/DFurnes/gists{/gist_id}","starred_url":"https://api.github.com/users/DFurnes/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DFurnes/subscriptions","organizations_url":"https://api.github.com/users/DFurnes/orgs","repos_url":"https://api.github.com/users/DFurnes/repos","events_url":"https://api.github.com/users/DFurnes/events{/privacy}","received_events_url":"https://api.github.com/users/DFurnes/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2016-04-19T17:59:20Z","updated_at":"2016-04-19T18:36:53Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/DoSomething/northstar/pulls/342","html_url":"https://github.com/DoSomething/northstar/pull/342","diff_url":"https://github.com/DoSomething/northstar/pull/342.diff","patch_url":"https://github.com/DoSomething/northstar/pull/342.patch"},"body":"#### What's this PR do?\r\n~~Thinking it might be worth trying this again on Thor, and manually attempting the migrations if they fail again. If it doesn't work, we can always \"re-clone\" Thor from the production database.~~ \r\n\r\nA ha!! 😲 I think the rename table migration was failing because the `clients` table already existed in the database (perhaps because a request made during the deploy was making a query against the table and therefore creating it...?). When I updated the `renameCollection` call to set the [`dropTarget` parameter](https://docs.mongodb.org/manual/reference/method/db.collection.renameCollection/) to `true` and ran each line of the migrations by hand, everything worked as expected!\r\n\r\n#### How should this be reviewed?\r\nTake a look, does it seem reasonable (again)?\r\n\r\nIf merged in to `dev`, this will be automatically deployed to QA & Thor. Since the migrations already ran on my \"test deploy\" to Thor (and then were successfully \"re-run\" by hand), they won't run there but _should_ run and correctly update tables on QA.\r\n\r\n#### Checklist\r\n- [ ] Documentation added for changed endpoints.\r\n- [ ] Tests added for new features/bug fixes.\r\n\r\n---\r\nFor review: @angaither "},"comment":{"url":"https://api.github.com/repos/DoSomething/northstar/issues/comments/212061813","html_url":"https://github.com/DoSomething/northstar/pull/342#issuecomment-212061813","issue_url":"https://api.github.com/repos/DoSomething/northstar/issues/342","id":212061813,"user":{"login":"angaither","id":645205,"avatar_url":"https://avatars.githubusercontent.com/u/645205?v=3","gravatar_id":"","url":"https://api.github.com/users/angaither","html_url":"https://github.com/angaither","followers_url":"https://api.github.com/users/angaither/followers","following_url":"https://api.github.com/users/angaither/following{/other_user}","gists_url":"https://api.github.com/users/angaither/gists{/gist_id}","starred_url":"https://api.github.com/users/angaither/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/angaither/subscriptions","organizations_url":"https://api.github.com/users/angaither/orgs","repos_url":"https://api.github.com/users/angaither/repos","events_url":"https://api.github.com/users/angaither/events{/privacy}","received_events_url":"https://api.github.com/users/angaither/received_events","type":"User","site_admin":false},"created_at":"2016-04-19T18:36:53Z","updated_at":"2016-04-19T18:36:53Z","body":"![](https://media.giphy.com/media/SJia77kCBt3by/giphy.gif)"}}