{"action":"closed","number":843,"pull_request":{"url":"https://api.github.com/repos/robmorgan/phinx/pulls/843","id":70656599,"html_url":"https://github.com/robmorgan/phinx/pull/843","diff_url":"https://github.com/robmorgan/phinx/pull/843.diff","patch_url":"https://github.com/robmorgan/phinx/pull/843.patch","issue_url":"https://api.github.com/repos/robmorgan/phinx/issues/843","number":843,"state":"closed","locked":false,"title":"Allowing configuration to be loaded form environment variables","user":{"login":"aalexgabi","id":600821,"avatar_url":"https://avatars.githubusercontent.com/u/600821?v=3","gravatar_id":"","url":"https://api.github.com/users/aalexgabi","html_url":"https://github.com/aalexgabi","followers_url":"https://api.github.com/users/aalexgabi/followers","following_url":"https://api.github.com/users/aalexgabi/following{/other_user}","gists_url":"https://api.github.com/users/aalexgabi/gists{/gist_id}","starred_url":"https://api.github.com/users/aalexgabi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aalexgabi/subscriptions","organizations_url":"https://api.github.com/users/aalexgabi/orgs","repos_url":"https://api.github.com/users/aalexgabi/repos","events_url":"https://api.github.com/users/aalexgabi/events{/privacy}","received_events_url":"https://api.github.com/users/aalexgabi/received_events","type":"User","site_admin":false},"body":"User story: We have one database per customer but one single software version deployed. We need to automate the migration of these bases. For this I made a multi-threaded script that executes a shell command for each database. The shell command gets database credentials from environment variables set up by the script. Generating the phinx configuration for each database in shell is cumbersome and not user friendly. So I added support for loading configuration from environment variables in phinx. Another approach would have been to add command line options but given the way phinx is designed (based on the assumption that we have a configuration file and not a configuration source), I would have needed to change a lot of things.\r\n\r\nThis is how it works now:\r\n```\r\ndb-looper PHINX_DB_NAME=$DB_NAME PHINX_DB_USER=$DB_USER PHINX_PATHS_MIGRATIONS=. phinx -p env migrate\r\n```\r\n\r\nFeel free to change it if you think it's not coherent with design/patterns/naming conventions etc.\r\n\r\nI would like to be able to add unit tests tests for this but unfortunately I have very limited time.","created_at":"2016-05-19T08:49:30Z","updated_at":"2016-06-24T18:28:03Z","closed_at":"2016-06-24T18:28:03Z","merged_at":null,"merge_commit_sha":"a69b61ce125020087f97626e9164e7b1275e3ca7","assignee":{"login":"rquadling","id":12801,"avatar_url":"https://avatars.githubusercontent.com/u/12801?v=3","gravatar_id":"","url":"https://api.github.com/users/rquadling","html_url":"https://github.com/rquadling","followers_url":"https://api.github.com/users/rquadling/followers","following_url":"https://api.github.com/users/rquadling/following{/other_user}","gists_url":"https://api.github.com/users/rquadling/gists{/gist_id}","starred_url":"https://api.github.com/users/rquadling/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rquadling/subscriptions","organizations_url":"https://api.github.com/users/rquadling/orgs","repos_url":"https://api.github.com/users/rquadling/repos","events_url":"https://api.github.com/users/rquadling/events{/privacy}","received_events_url":"https://api.github.com/users/rquadling/received_events","type":"User","site_admin":false},"assignees":[{"login":"rquadling","id":12801,"avatar_url":"https://avatars.githubusercontent.com/u/12801?v=3","gravatar_id":"","url":"https://api.github.com/users/rquadling","html_url":"https://github.com/rquadling","followers_url":"https://api.github.com/users/rquadling/followers","following_url":"https://api.github.com/users/rquadling/following{/other_user}","gists_url":"https://api.github.com/users/rquadling/gists{/gist_id}","starred_url":"https://api.github.com/users/rquadling/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rquadling/subscriptions","organizations_url":"https://api.github.com/users/rquadling/orgs","repos_url":"https://api.github.com/users/rquadling/repos","events_url":"https://api.github.com/users/rquadling/events{/privacy}","received_events_url":"https://api.github.com/users/rquadling/received_events","type":"User","site_admin":false}],"milestone":null,"commits_url":"https://api.github.com/repos/robmorgan/phinx/pulls/843/commits","review_comments_url":"https://api.github.com/repos/robmorgan/phinx/pulls/843/comments","review_comment_url":"https://api.github.com/repos/robmorgan/phinx/pulls/comments{/number}","comments_url":"https://api.github.com/repos/robmorgan/phinx/issues/843/comments","statuses_url":"https://api.github.com/repos/robmorgan/phinx/statuses/a9a833f317e2add24e35d6bc7b020465639c28af","head":{"label":"aalexgabi:0.5.x-dev","ref":"0.5.x-dev","sha":"a9a833f317e2add24e35d6bc7b020465639c28af","user":{"login":"aalexgabi","id":600821,"avatar_url":"https://avatars.githubusercontent.com/u/600821?v=3","gravatar_id":"","url":"https://api.github.com/users/aalexgabi","html_url":"https://github.com/aalexgabi","followers_url":"https://api.github.com/users/aalexgabi/followers","following_url":"https://api.github.com/users/aalexgabi/following{/other_user}","gists_url":"https://api.github.com/users/aalexgabi/gists{/gist_id}","starred_url":"https://api.github.com/users/aalexgabi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aalexgabi/subscriptions","organizations_url":"https://api.github.com/users/aalexgabi/orgs","repos_url":"https://api.github.com/users/aalexgabi/repos","events_url":"https://api.github.com/users/aalexgabi/events{/privacy}","received_events_url":"https://api.github.com/users/aalexgabi/received_events","type":"User","site_admin":false},"repo":{"id":59186809,"name":"phinx","full_name":"aalexgabi/phinx","owner":{"login":"aalexgabi","id":600821,"avatar_url":"https://avatars.githubusercontent.com/u/600821?v=3","gravatar_id":"","url":"https://api.github.com/users/aalexgabi","html_url":"https://github.com/aalexgabi","followers_url":"https://api.github.com/users/aalexgabi/followers","following_url":"https://api.github.com/users/aalexgabi/following{/other_user}","gists_url":"https://api.github.com/users/aalexgabi/gists{/gist_id}","starred_url":"https://api.github.com/users/aalexgabi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aalexgabi/subscriptions","organizations_url":"https://api.github.com/users/aalexgabi/orgs","repos_url":"https://api.github.com/users/aalexgabi/repos","events_url":"https://api.github.com/users/aalexgabi/events{/privacy}","received_events_url":"https://api.github.com/users/aalexgabi/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/aalexgabi/phinx","description":"PHP Database Migrations for Everyone","fork":true,"url":"https://api.github.com/repos/aalexgabi/phinx","forks_url":"https://api.github.com/repos/aalexgabi/phinx/forks","keys_url":"https://api.github.com/repos/aalexgabi/phinx/keys{/key_id}","collaborators_url":"https://api.github.com/repos/aalexgabi/phinx/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/aalexgabi/phinx/teams","hooks_url":"https://api.github.com/repos/aalexgabi/phinx/hooks","issue_events_url":"https://api.github.com/repos/aalexgabi/phinx/issues/events{/number}","events_url":"https://api.github.com/repos/aalexgabi/phinx/events","assignees_url":"https://api.github.com/repos/aalexgabi/phinx/assignees{/user}","branches_url":"https://api.github.com/repos/aalexgabi/phinx/branches{/branch}","tags_url":"https://api.github.com/repos/aalexgabi/phinx/tags","blobs_url":"https://api.github.com/repos/aalexgabi/phinx/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/aalexgabi/phinx/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/aalexgabi/phinx/git/refs{/sha}","trees_url":"https://api.github.com/repos/aalexgabi/phinx/git/trees{/sha}","statuses_url":"https://api.github.com/repos/aalexgabi/phinx/statuses/{sha}","languages_url":"https://api.github.com/repos/aalexgabi/phinx/languages","stargazers_url":"https://api.github.com/repos/aalexgabi/phinx/stargazers","contributors_url":"https://api.github.com/repos/aalexgabi/phinx/contributors","subscribers_url":"https://api.github.com/repos/aalexgabi/phinx/subscribers","subscription_url":"https://api.github.com/repos/aalexgabi/phinx/subscription","commits_url":"https://api.github.com/repos/aalexgabi/phinx/commits{/sha}","git_commits_url":"https://api.github.com/repos/aalexgabi/phinx/git/commits{/sha}","comments_url":"https://api.github.com/repos/aalexgabi/phinx/comments{/number}","issue_comment_url":"https://api.github.com/repos/aalexgabi/phinx/issues/comments{/number}","contents_url":"https://api.github.com/repos/aalexgabi/phinx/contents/{+path}","compare_url":"https://api.github.com/repos/aalexgabi/phinx/compare/{base}...{head}","merges_url":"https://api.github.com/repos/aalexgabi/phinx/merges","archive_url":"https://api.github.com/repos/aalexgabi/phinx/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/aalexgabi/phinx/downloads","issues_url":"https://api.github.com/repos/aalexgabi/phinx/issues{/number}","pulls_url":"https://api.github.com/repos/aalexgabi/phinx/pulls{/number}","milestones_url":"https://api.github.com/repos/aalexgabi/phinx/milestones{/number}","notifications_url":"https://api.github.com/repos/aalexgabi/phinx/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/aalexgabi/phinx/labels{/name}","releases_url":"https://api.github.com/repos/aalexgabi/phinx/releases{/id}","deployments_url":"https://api.github.com/repos/aalexgabi/phinx/deployments","created_at":"2016-05-19T08:10:30Z","updated_at":"2016-05-19T08:10:31Z","pushed_at":"2016-05-19T08:18:49Z","git_url":"git://github.com/aalexgabi/phinx.git","ssh_url":"git@github.com:aalexgabi/phinx.git","clone_url":"https://github.com/aalexgabi/phinx.git","svn_url":"https://github.com/aalexgabi/phinx","homepage":"https://phinx.org","size":3584,"stargazers_count":0,"watchers_count":0,"language":"PHP","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"0.5.x-dev"}},"base":{"label":"robmorgan:0.5.x-dev","ref":"0.5.x-dev","sha":"2fc65d95941b213e0f18e5898ff63771d19065b8","user":{"login":"robmorgan","id":178939,"avatar_url":"https://avatars.githubusercontent.com/u/178939?v=3","gravatar_id":"","url":"https://api.github.com/users/robmorgan","html_url":"https://github.com/robmorgan","followers_url":"https://api.github.com/users/robmorgan/followers","following_url":"https://api.github.com/users/robmorgan/following{/other_user}","gists_url":"https://api.github.com/users/robmorgan/gists{/gist_id}","starred_url":"https://api.github.com/users/robmorgan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/robmorgan/subscriptions","organizations_url":"https://api.github.com/users/robmorgan/orgs","repos_url":"https://api.github.com/users/robmorgan/repos","events_url":"https://api.github.com/users/robmorgan/events{/privacy}","received_events_url":"https://api.github.com/users/robmorgan/received_events","type":"User","site_admin":false},"repo":{"id":3055234,"name":"phinx","full_name":"robmorgan/phinx","owner":{"login":"robmorgan","id":178939,"avatar_url":"https://avatars.githubusercontent.com/u/178939?v=3","gravatar_id":"","url":"https://api.github.com/users/robmorgan","html_url":"https://github.com/robmorgan","followers_url":"https://api.github.com/users/robmorgan/followers","following_url":"https://api.github.com/users/robmorgan/following{/other_user}","gists_url":"https://api.github.com/users/robmorgan/gists{/gist_id}","starred_url":"https://api.github.com/users/robmorgan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/robmorgan/subscriptions","organizations_url":"https://api.github.com/users/robmorgan/orgs","repos_url":"https://api.github.com/users/robmorgan/repos","events_url":"https://api.github.com/users/robmorgan/events{/privacy}","received_events_url":"https://api.github.com/users/robmorgan/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/robmorgan/phinx","description":"PHP Database Migrations for Everyone","fork":false,"url":"https://api.github.com/repos/robmorgan/phinx","forks_url":"https://api.github.com/repos/robmorgan/phinx/forks","keys_url":"https://api.github.com/repos/robmorgan/phinx/keys{/key_id}","collaborators_url":"https://api.github.com/repos/robmorgan/phinx/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/robmorgan/phinx/teams","hooks_url":"https://api.github.com/repos/robmorgan/phinx/hooks","issue_events_url":"https://api.github.com/repos/robmorgan/phinx/issues/events{/number}","events_url":"https://api.github.com/repos/robmorgan/phinx/events","assignees_url":"https://api.github.com/repos/robmorgan/phinx/assignees{/user}","branches_url":"https://api.github.com/repos/robmorgan/phinx/branches{/branch}","tags_url":"https://api.github.com/repos/robmorgan/phinx/tags","blobs_url":"https://api.github.com/repos/robmorgan/phinx/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/robmorgan/phinx/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/robmorgan/phinx/git/refs{/sha}","trees_url":"https://api.github.com/repos/robmorgan/phinx/git/trees{/sha}","statuses_url":"https://api.github.com/repos/robmorgan/phinx/statuses/{sha}","languages_url":"https://api.github.com/repos/robmorgan/phinx/languages","stargazers_url":"https://api.github.com/repos/robmorgan/phinx/stargazers","contributors_url":"https://api.github.com/repos/robmorgan/phinx/contributors","subscribers_url":"https://api.github.com/repos/robmorgan/phinx/subscribers","subscription_url":"https://api.github.com/repos/robmorgan/phinx/subscription","commits_url":"https://api.github.com/repos/robmorgan/phinx/commits{/sha}","git_commits_url":"https://api.github.com/repos/robmorgan/phinx/git/commits{/sha}","comments_url":"https://api.github.com/repos/robmorgan/phinx/comments{/number}","issue_comment_url":"https://api.github.com/repos/robmorgan/phinx/issues/comments{/number}","contents_url":"https://api.github.com/repos/robmorgan/phinx/contents/{+path}","compare_url":"https://api.github.com/repos/robmorgan/phinx/compare/{base}...{head}","merges_url":"https://api.github.com/repos/robmorgan/phinx/merges","archive_url":"https://api.github.com/repos/robmorgan/phinx/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/robmorgan/phinx/downloads","issues_url":"https://api.github.com/repos/robmorgan/phinx/issues{/number}","pulls_url":"https://api.github.com/repos/robmorgan/phinx/pulls{/number}","milestones_url":"https://api.github.com/repos/robmorgan/phinx/milestones{/number}","notifications_url":"https://api.github.com/repos/robmorgan/phinx/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/robmorgan/phinx/labels{/name}","releases_url":"https://api.github.com/repos/robmorgan/phinx/releases{/id}","deployments_url":"https://api.github.com/repos/robmorgan/phinx/deployments","created_at":"2011-12-27T06:49:45Z","updated_at":"2016-06-24T08:39:27Z","pushed_at":"2016-06-24T18:27:53Z","git_url":"git://github.com/robmorgan/phinx.git","ssh_url":"git@github.com:robmorgan/phinx.git","clone_url":"https://github.com/robmorgan/phinx.git","svn_url":"https://github.com/robmorgan/phinx","homepage":"https://phinx.org","size":5955,"stargazers_count":2316,"watchers_count":2316,"language":"PHP","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":505,"mirror_url":null,"open_issues_count":229,"forks":505,"open_issues":229,"watchers":2316,"default_branch":"0.6.x-dev"}},"_links":{"self":{"href":"https://api.github.com/repos/robmorgan/phinx/pulls/843"},"html":{"href":"https://github.com/robmorgan/phinx/pull/843"},"issue":{"href":"https://api.github.com/repos/robmorgan/phinx/issues/843"},"comments":{"href":"https://api.github.com/repos/robmorgan/phinx/issues/843/comments"},"review_comments":{"href":"https://api.github.com/repos/robmorgan/phinx/pulls/843/comments"},"review_comment":{"href":"https://api.github.com/repos/robmorgan/phinx/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/robmorgan/phinx/pulls/843/commits"},"statuses":{"href":"https://api.github.com/repos/robmorgan/phinx/statuses/a9a833f317e2add24e35d6bc7b020465639c28af"}},"merged":false,"mergeable":true,"mergeable_state":"unstable","merged_by":null,"comments":6,"review_comments":0,"commits":1,"additions":46,"deletions":6,"changed_files":2}}
{"actor":{"display_login":"aalexgabi"}}