{"action":"created","issue":{"url":"https://api.github.com/repos/gocd/gocd/issues/3657","repository_url":"https://api.github.com/repos/gocd/gocd","labels_url":"https://api.github.com/repos/gocd/gocd/issues/3657/labels{/name}","comments_url":"https://api.github.com/repos/gocd/gocd/issues/3657/comments","events_url":"https://api.github.com/repos/gocd/gocd/issues/3657/events","html_url":"https://github.com/gocd/gocd/issues/3657","id":242900074,"number":3657,"title":"DB migration when rolling back","user":{"login":"ketan","id":10598,"avatar_url":"https://avatars7.githubusercontent.com/u/10598?v=4","gravatar_id":"","url":"https://api.github.com/users/ketan","html_url":"https://github.com/ketan","followers_url":"https://api.github.com/users/ketan/followers","following_url":"https://api.github.com/users/ketan/following{/other_user}","gists_url":"https://api.github.com/users/ketan/gists{/gist_id}","starred_url":"https://api.github.com/users/ketan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ketan/subscriptions","organizations_url":"https://api.github.com/users/ketan/orgs","repos_url":"https://api.github.com/users/ketan/repos","events_url":"https://api.github.com/users/ketan/events{/privacy}","received_events_url":"https://api.github.com/users/ketan/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2017-07-14T05:21:31Z","updated_at":"2017-07-14T07:06:53Z","closed_at":"2017-07-14T06:55:09Z","body":"##### Issue Type\r\n\r\n- Bug Report\r\n\r\n##### Summary\r\n\r\nWhen rolling back a deployment, the DB migrations from an older release are applied.\r\n\r\n##### Environment\r\n\r\nSteps to reproduce\r\n\r\n```shell\r\nrm -rf godata && mkdir -p godata\r\n\r\n# install new version of gocd\r\ndocker run --name gocd -d -v$(pwd)/godata:/godata -p8153:8153 -p8154:8154 gocd/gocd-server:v17.7.0\r\nsleep 60 # wait a minute for the db migrations to execute\r\ndocker stop gocd && docker rm gocd\r\nrm -rf godata/{config,logs} godata/db/{h2db,config.git} # pretend that you put in an old db and config from a backup in that location\r\n\r\n# rollback to older release\r\ndocker run --name gocd -d -v$(pwd)/godata:/godata -p8153:8153 -p8154:8154 gocd/gocd-server:v17.3.0\r\nsleep 60 # wait a minute for the db migrations to execute\r\ndocker stop gocd && docker rm gocd\r\nless godata/logs/go-server.out.log #look out for DB exceptions\r\n```\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/gocd/gocd/issues/comments/315287762","html_url":"https://github.com/gocd/gocd/issues/3657#issuecomment-315287762","issue_url":"https://api.github.com/repos/gocd/gocd/issues/3657","id":315287762,"user":{"login":"ketan","id":10598,"avatar_url":"https://avatars7.githubusercontent.com/u/10598?v=4","gravatar_id":"","url":"https://api.github.com/users/ketan","html_url":"https://github.com/ketan","followers_url":"https://api.github.com/users/ketan/followers","following_url":"https://api.github.com/users/ketan/following{/other_user}","gists_url":"https://api.github.com/users/ketan/gists{/gist_id}","starred_url":"https://api.github.com/users/ketan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ketan/subscriptions","organizations_url":"https://api.github.com/users/ketan/orgs","repos_url":"https://api.github.com/users/ketan/repos","events_url":"https://api.github.com/users/ketan/events{/privacy}","received_events_url":"https://api.github.com/users/ketan/received_events","type":"User","site_admin":false},"created_at":"2017-07-14T07:06:53Z","updated_at":"2017-07-14T07:06:53Z","body":"Looking at the source code for dbdeploy, it only seems to understand deltas from `File` objects. So perhaps the fix is to extract deltas to a temp dir and remove the dir after deltas have been applied."}}
{"actor":{"display_login":"ketan"}}