{"action":"created","issue":{"url":"https://api.github.com/repos/docker/compose/issues/3186","repository_url":"https://api.github.com/repos/docker/compose","labels_url":"https://api.github.com/repos/docker/compose/issues/3186/labels{/name}","comments_url":"https://api.github.com/repos/docker/compose/issues/3186/comments","events_url":"https://api.github.com/repos/docker/compose/issues/3186/events","html_url":"https://github.com/docker/compose/issues/3186","id":142740423,"number":3186,"title":"Upgrading app containers and apps running on containers","user":{"login":"formerlyKurt","id":12293121,"avatar_url":"https://avatars.githubusercontent.com/u/12293121?v=3","gravatar_id":"","url":"https://api.github.com/users/formerlyKurt","html_url":"https://github.com/formerlyKurt","followers_url":"https://api.github.com/users/formerlyKurt/followers","following_url":"https://api.github.com/users/formerlyKurt/following{/other_user}","gists_url":"https://api.github.com/users/formerlyKurt/gists{/gist_id}","starred_url":"https://api.github.com/users/formerlyKurt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/formerlyKurt/subscriptions","organizations_url":"https://api.github.com/users/formerlyKurt/orgs","repos_url":"https://api.github.com/users/formerlyKurt/repos","events_url":"https://api.github.com/users/formerlyKurt/events{/privacy}","received_events_url":"https://api.github.com/users/formerlyKurt/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/docker/compose/labels/kind/question","name":"kind/question","color":"cc317c"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2016-03-22T18:37:08Z","updated_at":"2016-03-30T18:29:39Z","closed_at":null,"body":"So, I've read the best practices approach for [linking containers](https://docs.docker.com/v1.8/userguide/dockerlinks/) and agree with this recommendation. However, am wondering what the recommendation would be to upgrade a dependent container. For example, let's say that I need to upgrade my Postgres database. Better yet, I need to update the schema on a running database container, then update the dependent app `A` all while the app is still available. My current thinking is that I can bring up a new database container, run some upgrade scripts against the schema, then startup a new dependent app `A'`. However, if the database data is a mounted volume, then that will affect both `A` and `A'`\r\n\r\nI'm pretty sure that this has already been solved so I'm curious to hear how and/or any recommendations on how to handle these scenarios.\r\n\r\nThanks!"},"comment":{"url":"https://api.github.com/repos/docker/compose/issues/comments/203568773","html_url":"https://github.com/docker/compose/issues/3186#issuecomment-203568773","issue_url":"https://api.github.com/repos/docker/compose/issues/3186","id":203568773,"user":{"login":"jayfk","id":2930472,"avatar_url":"https://avatars.githubusercontent.com/u/2930472?v=3","gravatar_id":"","url":"https://api.github.com/users/jayfk","html_url":"https://github.com/jayfk","followers_url":"https://api.github.com/users/jayfk/followers","following_url":"https://api.github.com/users/jayfk/following{/other_user}","gists_url":"https://api.github.com/users/jayfk/gists{/gist_id}","starred_url":"https://api.github.com/users/jayfk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jayfk/subscriptions","organizations_url":"https://api.github.com/users/jayfk/orgs","repos_url":"https://api.github.com/users/jayfk/repos","events_url":"https://api.github.com/users/jayfk/events{/privacy}","received_events_url":"https://api.github.com/users/jayfk/received_events","type":"User","site_admin":false},"created_at":"2016-03-30T18:29:39Z","updated_at":"2016-03-30T18:29:39Z","body":"I think the best way to solve problems like this is on the application layer. When it comes to database migrations, I always make sure to create one that runs with both `A` and `A'`.\r\n\r\nFor example, renaming a column from `foo` to `bar`:\r\n  - Create a new column `bar`\r\n  - Copy `foo` into `bar`\r\n  - deploy\r\n  - make sure that everything works and you don't need to jump back\r\n  - delete `foo`\r\n\r\n"}}