{"action":"created","issue":{"url":"https://api.github.com/repos/cloudant/CDTDatastore/issues/320","repository_url":"https://api.github.com/repos/cloudant/CDTDatastore","labels_url":"https://api.github.com/repos/cloudant/CDTDatastore/issues/320/labels{/name}","comments_url":"https://api.github.com/repos/cloudant/CDTDatastore/issues/320/comments","events_url":"https://api.github.com/repos/cloudant/CDTDatastore/issues/320/events","html_url":"https://github.com/cloudant/CDTDatastore/pull/320","id":176594523,"number":320,"title":"Recover from errors during migration.","user":{"login":"rhyshort","id":1616727,"avatar_url":"https://avatars.githubusercontent.com/u/1616727?v=3","gravatar_id":"","url":"https://api.github.com/users/rhyshort","html_url":"https://github.com/rhyshort","followers_url":"https://api.github.com/users/rhyshort/followers","following_url":"https://api.github.com/users/rhyshort/following{/other_user}","gists_url":"https://api.github.com/users/rhyshort/gists{/gist_id}","starred_url":"https://api.github.com/users/rhyshort/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rhyshort/subscriptions","organizations_url":"https://api.github.com/users/rhyshort/orgs","repos_url":"https://api.github.com/users/rhyshort/repos","events_url":"https://api.github.com/users/rhyshort/events{/privacy}","received_events_url":"https://api.github.com/users/rhyshort/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-09-13T09:38:38Z","updated_at":"2016-09-13T17:04:13Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/cloudant/CDTDatastore/pulls/320","html_url":"https://github.com/cloudant/CDTDatastore/pull/320","diff_url":"https://github.com/cloudant/CDTDatastore/pull/320.diff","patch_url":"https://github.com/cloudant/CDTDatastore/pull/320.patch"},"body":"## What\r\nRecover from errors during database migration by make schema updates in\r\na transaction and rolling back whenever an error occurs.\r\n\r\n## How\r\n- Move migrations to being run inside a transaction, so they can be rolled back in the event of an error.\r\n- Check the return value from the `generateAndInsertFilenameBasedOnKey:intoBlobFilenamesTableInDatabase` method, so we can rollback if a attachment failed to be moved.\r\n\r\n## Tests\r\n\r\nAll current tests pass, I'm not entirely sure how to force FMDB to error so we can test rollbacks, any advice on this would be appreciated.\r\n\r\n## Issues\r\n\r\nFixes #278"},"comment":{"url":"https://api.github.com/repos/cloudant/CDTDatastore/issues/comments/246751425","html_url":"https://github.com/cloudant/CDTDatastore/pull/320#issuecomment-246751425","issue_url":"https://api.github.com/repos/cloudant/CDTDatastore/issues/320","id":246751425,"user":{"login":"ricellis","id":10698320,"avatar_url":"https://avatars.githubusercontent.com/u/10698320?v=3","gravatar_id":"","url":"https://api.github.com/users/ricellis","html_url":"https://github.com/ricellis","followers_url":"https://api.github.com/users/ricellis/followers","following_url":"https://api.github.com/users/ricellis/following{/other_user}","gists_url":"https://api.github.com/users/ricellis/gists{/gist_id}","starred_url":"https://api.github.com/users/ricellis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ricellis/subscriptions","organizations_url":"https://api.github.com/users/ricellis/orgs","repos_url":"https://api.github.com/users/ricellis/repos","events_url":"https://api.github.com/users/ricellis/events{/privacy}","received_events_url":"https://api.github.com/users/ricellis/received_events","type":"User","site_admin":false},"created_at":"2016-09-13T17:04:13Z","updated_at":"2016-09-13T17:04:13Z","body":"+1"}}
{"actor":{"display_login":"ricellis"}}