{"action":"created","comment":{"url":"https://api.github.com/repos/sclorg/postgresql-container/pulls/comments/107139427","pull_request_review_id":28092138,"id":107139427,"diff_hunk":"@@ -187,6 +200,23 @@ function set_passwords() {\n   fi\n }\n \n+migrate_db ()\n+{\n+    test \"$postinitdb_actions\" = \",migration\" || return 0\n+\n+    # Migration path.\n+    (\n+        if [ ${POSTGRESQL_MIGRATION_IGNORE_ERRORS-no} = no ]; then\n+            echo '\\set ON_ERROR_STOP on'\n+        fi\n+        # initdb automatically creates 'postgres' role;  creating it again would\n+        # fail the whole migration so we drop it here\n+        PGPASSWORD=\"$POSTGRESQL_MIGRATION_ADMIN_PASSWORD\" \\\n+        pg_dumpall -h \"$POSTGRESQL_MIGRATION_REMOTE_HOST\" \\\n+            | grep -v '^CREATE ROLE postgres'","path":"9.5/root/usr/share/container-scripts/postgresql/common.sh","position":60,"original_position":60,"commit_id":"316bfc37206b63aae9d56d3e4c470504846fa0f4","original_commit_id":"316bfc37206b63aae9d56d3e4c470504846fa0f4","user":{"login":"praiskup","id":3277839,"avatar_url":"https://avatars0.githubusercontent.com/u/3277839?v=3","gravatar_id":"","url":"https://api.github.com/users/praiskup","html_url":"https://github.com/praiskup","followers_url":"https://api.github.com/users/praiskup/followers","following_url":"https://api.github.com/users/praiskup/following{/other_user}","gists_url":"https://api.github.com/users/praiskup/gists{/gist_id}","starred_url":"https://api.github.com/users/praiskup/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/praiskup/subscriptions","organizations_url":"https://api.github.com/users/praiskup/orgs","repos_url":"https://api.github.com/users/praiskup/repos","events_url":"https://api.github.com/users/praiskup/events{/privacy}","received_events_url":"https://api.github.com/users/praiskup/received_events","type":"User","site_admin":false},"body":"Good point, thanks.","created_at":"2017-03-21T12:19:46Z","updated_at":"2017-03-21T12:19:46Z","html_url":"https://github.com/sclorg/postgresql-container/pull/165#discussion_r107139427","pull_request_url":"https://api.github.com/repos/sclorg/postgresql-container/pulls/165","_links":{"self":{"href":"https://api.github.com/repos/sclorg/postgresql-container/pulls/comments/107139427"},"html":{"href":"https://github.com/sclorg/postgresql-container/pull/165#discussion_r107139427"},"pull_request":{"href":"https://api.github.com/repos/sclorg/postgresql-container/pulls/165"}}},"pull_request":{"url":"https://api.github.com/repos/sclorg/postgresql-container/pulls/165","id":110472108,"html_url":"https://github.com/sclorg/postgresql-container/pull/165","diff_url":"https://github.com/sclorg/postgresql-container/pull/165.diff","patch_url":"https://github.com/sclorg/postgresql-container/pull/165.patch","issue_url":"https://api.github.com/repos/sclorg/postgresql-container/issues/165","number":165,"state":"open","locked":false,"title":"migration: add basic construct to help with migrations","user":{"login":"praiskup","id":3277839,"avatar_url":"https://avatars0.githubusercontent.com/u/3277839?v=3","gravatar_id":"","url":"https://api.github.com/users/praiskup","html_url":"https://github.com/praiskup","followers_url":"https://api.github.com/users/praiskup/followers","following_url":"https://api.github.com/users/praiskup/following{/other_user}","gists_url":"https://api.github.com/users/praiskup/gists{/gist_id}","starred_url":"https://api.github.com/users/praiskup/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/praiskup/subscriptions","organizations_url":"https://api.github.com/users/praiskup/orgs","repos_url":"https://api.github.com/users/praiskup/repos","events_url":"https://api.github.com/users/praiskup/events{/privacy}","received_events_url":"https://api.github.com/users/praiskup/received_events","type":"User","site_admin":false},"body":"The dump & restore way.","created_at":"2017-03-13T18:45:54Z","updated_at":"2017-03-21T12:19:46Z","closed_at":null,"merged_at":null,"merge_commit_sha":"94a0d8104fdb3736cf270fd97abb4c63ddf3cff9","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/sclorg/postgresql-container/pulls/165/commits","review_comments_url":"https://api.github.com/repos/sclorg/postgresql-container/pulls/165/comments","review_comment_url":"https://api.github.com/repos/sclorg/postgresql-container/pulls/comments{/number}","comments_url":"https://api.github.com/repos/sclorg/postgresql-container/issues/165/comments","statuses_url":"https://api.github.com/repos/sclorg/postgresql-container/statuses/316bfc37206b63aae9d56d3e4c470504846fa0f4","head":{"label":"praiskup:praiskup-migration","ref":"praiskup-migration","sha":"316bfc37206b63aae9d56d3e4c470504846fa0f4","user":{"login":"praiskup","id":3277839,"avatar_url":"https://avatars0.githubusercontent.com/u/3277839?v=3","gravatar_id":"","url":"https://api.github.com/users/praiskup","html_url":"https://github.com/praiskup","followers_url":"https://api.github.com/users/praiskup/followers","following_url":"https://api.github.com/users/praiskup/following{/other_user}","gists_url":"https://api.github.com/users/praiskup/gists{/gist_id}","starred_url":"https://api.github.com/users/praiskup/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/praiskup/subscriptions","organizations_url":"https://api.github.com/users/praiskup/orgs","repos_url":"https://api.github.com/users/praiskup/repos","events_url":"https://api.github.com/users/praiskup/events{/privacy}","received_events_url":"https://api.github.com/users/praiskup/received_events","type":"User","site_admin":false},"repo":{"id":39621678,"name":"openshift-postgresql","full_name":"praiskup/openshift-postgresql","owner":{"login":"praiskup","id":3277839,"avatar_url":"https://avatars0.githubusercontent.com/u/3277839?v=3","gravatar_id":"","url":"https://api.github.com/users/praiskup","html_url":"https://github.com/praiskup","followers_url":"https://api.github.com/users/praiskup/followers","following_url":"https://api.github.com/users/praiskup/following{/other_user}","gists_url":"https://api.github.com/users/praiskup/gists{/gist_id}","starred_url":"https://api.github.com/users/praiskup/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/praiskup/subscriptions","organizations_url":"https://api.github.com/users/praiskup/orgs","repos_url":"https://api.github.com/users/praiskup/repos","events_url":"https://api.github.com/users/praiskup/events{/privacy}","received_events_url":"https://api.github.com/users/praiskup/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/praiskup/openshift-postgresql","description":null,"fork":true,"url":"https://api.github.com/repos/praiskup/openshift-postgresql","forks_url":"https://api.github.com/repos/praiskup/openshift-postgresql/forks","keys_url":"https://api.github.com/repos/praiskup/openshift-postgresql/keys{/key_id}","collaborators_url":"https://api.github.com/repos/praiskup/openshift-postgresql/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/praiskup/openshift-postgresql/teams","hooks_url":"https://api.github.com/repos/praiskup/openshift-postgresql/hooks","issue_events_url":"https://api.github.com/repos/praiskup/openshift-postgresql/issues/events{/number}","events_url":"https://api.github.com/repos/praiskup/openshift-postgresql/events","assignees_url":"https://api.github.com/repos/praiskup/openshift-postgresql/assignees{/user}","branches_url":"https://api.github.com/repos/praiskup/openshift-postgresql/branches{/branch}","tags_url":"https://api.github.com/repos/praiskup/openshift-postgresql/tags","blobs_url":"https://api.github.com/repos/praiskup/openshift-postgresql/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/praiskup/openshift-postgresql/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/praiskup/openshift-postgresql/git/refs{/sha}","trees_url":"https://api.github.com/repos/praiskup/openshift-postgresql/git/trees{/sha}","statuses_url":"https://api.github.com/repos/praiskup/openshift-postgresql/statuses/{sha}","languages_url":"https://api.github.com/repos/praiskup/openshift-postgresql/languages","stargazers_url":"https://api.github.com/repos/praiskup/openshift-postgresql/stargazers","contributors_url":"https://api.github.com/repos/praiskup/openshift-postgresql/contributors","subscribers_url":"https://api.github.com/repos/praiskup/openshift-postgresql/subscribers","subscription_url":"https://api.github.com/repos/praiskup/openshift-postgresql/subscription","commits_url":"https://api.github.com/repos/praiskup/openshift-postgresql/commits{/sha}","git_commits_url":"https://api.github.com/repos/praiskup/openshift-postgresql/git/commits{/sha}","comments_url":"https://api.github.com/repos/praiskup/openshift-postgresql/comments{/number}","issue_comment_url":"https://api.github.com/repos/praiskup/openshift-postgresql/issues/comments{/number}","contents_url":"https://api.github.com/repos/praiskup/openshift-postgresql/contents/{+path}","compare_url":"https://api.github.com/repos/praiskup/openshift-postgresql/compare/{base}...{head}","merges_url":"https://api.github.com/repos/praiskup/openshift-postgresql/merges","archive_url":"https://api.github.com/repos/praiskup/openshift-postgresql/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/praiskup/openshift-postgresql/downloads","issues_url":"https://api.github.com/repos/praiskup/openshift-postgresql/issues{/number}","pulls_url":"https://api.github.com/repos/praiskup/openshift-postgresql/pulls{/number}","milestones_url":"https://api.github.com/repos/praiskup/openshift-postgresql/milestones{/number}","notifications_url":"https://api.github.com/repos/praiskup/openshift-postgresql/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/praiskup/openshift-postgresql/labels{/name}","releases_url":"https://api.github.com/repos/praiskup/openshift-postgresql/releases{/id}","deployments_url":"https://api.github.com/repos/praiskup/openshift-postgresql/deployments","created_at":"2015-07-24T08:50:04Z","updated_at":"2016-05-06T12:16:56Z","pushed_at":"2017-03-17T15:37:55Z","git_url":"git://github.com/praiskup/openshift-postgresql.git","ssh_url":"git@github.com:praiskup/openshift-postgresql.git","clone_url":"https://github.com/praiskup/openshift-postgresql.git","svn_url":"https://github.com/praiskup/openshift-postgresql","homepage":null,"size":268,"stargazers_count":0,"watchers_count":0,"language":"Shell","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"sclorg:master","ref":"master","sha":"2f9f70c98ec11ca7e3b3cabde65a41e97e12d263","user":{"login":"sclorg","id":9047960,"avatar_url":"https://avatars2.githubusercontent.com/u/9047960?v=3","gravatar_id":"","url":"https://api.github.com/users/sclorg","html_url":"https://github.com/sclorg","followers_url":"https://api.github.com/users/sclorg/followers","following_url":"https://api.github.com/users/sclorg/following{/other_user}","gists_url":"https://api.github.com/users/sclorg/gists{/gist_id}","starred_url":"https://api.github.com/users/sclorg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sclorg/subscriptions","organizations_url":"https://api.github.com/users/sclorg/orgs","repos_url":"https://api.github.com/users/sclorg/repos","events_url":"https://api.github.com/users/sclorg/events{/privacy}","received_events_url":"https://api.github.com/users/sclorg/received_events","type":"Organization","site_admin":false},"repo":{"id":32466378,"name":"postgresql-container","full_name":"sclorg/postgresql-container","owner":{"login":"sclorg","id":9047960,"avatar_url":"https://avatars2.githubusercontent.com/u/9047960?v=3","gravatar_id":"","url":"https://api.github.com/users/sclorg","html_url":"https://github.com/sclorg","followers_url":"https://api.github.com/users/sclorg/followers","following_url":"https://api.github.com/users/sclorg/following{/other_user}","gists_url":"https://api.github.com/users/sclorg/gists{/gist_id}","starred_url":"https://api.github.com/users/sclorg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sclorg/subscriptions","organizations_url":"https://api.github.com/users/sclorg/orgs","repos_url":"https://api.github.com/users/sclorg/repos","events_url":"https://api.github.com/users/sclorg/events{/privacy}","received_events_url":"https://api.github.com/users/sclorg/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/sclorg/postgresql-container","description":null,"fork":false,"url":"https://api.github.com/repos/sclorg/postgresql-container","forks_url":"https://api.github.com/repos/sclorg/postgresql-container/forks","keys_url":"https://api.github.com/repos/sclorg/postgresql-container/keys{/key_id}","collaborators_url":"https://api.github.com/repos/sclorg/postgresql-container/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/sclorg/postgresql-container/teams","hooks_url":"https://api.github.com/repos/sclorg/postgresql-container/hooks","issue_events_url":"https://api.github.com/repos/sclorg/postgresql-container/issues/events{/number}","events_url":"https://api.github.com/repos/sclorg/postgresql-container/events","assignees_url":"https://api.github.com/repos/sclorg/postgresql-container/assignees{/user}","branches_url":"https://api.github.com/repos/sclorg/postgresql-container/branches{/branch}","tags_url":"https://api.github.com/repos/sclorg/postgresql-container/tags","blobs_url":"https://api.github.com/repos/sclorg/postgresql-container/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/sclorg/postgresql-container/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/sclorg/postgresql-container/git/refs{/sha}","trees_url":"https://api.github.com/repos/sclorg/postgresql-container/git/trees{/sha}","statuses_url":"https://api.github.com/repos/sclorg/postgresql-container/statuses/{sha}","languages_url":"https://api.github.com/repos/sclorg/postgresql-container/languages","stargazers_url":"https://api.github.com/repos/sclorg/postgresql-container/stargazers","contributors_url":"https://api.github.com/repos/sclorg/postgresql-container/contributors","subscribers_url":"https://api.github.com/repos/sclorg/postgresql-container/subscribers","subscription_url":"https://api.github.com/repos/sclorg/postgresql-container/subscription","commits_url":"https://api.github.com/repos/sclorg/postgresql-container/commits{/sha}","git_commits_url":"https://api.github.com/repos/sclorg/postgresql-container/git/commits{/sha}","comments_url":"https://api.github.com/repos/sclorg/postgresql-container/comments{/number}","issue_comment_url":"https://api.github.com/repos/sclorg/postgresql-container/issues/comments{/number}","contents_url":"https://api.github.com/repos/sclorg/postgresql-container/contents/{+path}","compare_url":"https://api.github.com/repos/sclorg/postgresql-container/compare/{base}...{head}","merges_url":"https://api.github.com/repos/sclorg/postgresql-container/merges","archive_url":"https://api.github.com/repos/sclorg/postgresql-container/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/sclorg/postgresql-container/downloads","issues_url":"https://api.github.com/repos/sclorg/postgresql-container/issues{/number}","pulls_url":"https://api.github.com/repos/sclorg/postgresql-container/pulls{/number}","milestones_url":"https://api.github.com/repos/sclorg/postgresql-container/milestones{/number}","notifications_url":"https://api.github.com/repos/sclorg/postgresql-container/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/sclorg/postgresql-container/labels{/name}","releases_url":"https://api.github.com/repos/sclorg/postgresql-container/releases{/id}","deployments_url":"https://api.github.com/repos/sclorg/postgresql-container/deployments","created_at":"2015-03-18T15:15:33Z","updated_at":"2017-03-01T00:31:36Z","pushed_at":"2017-03-17T15:38:10Z","git_url":"git://github.com/sclorg/postgresql-container.git","ssh_url":"git@github.com:sclorg/postgresql-container.git","clone_url":"https://github.com/sclorg/postgresql-container.git","svn_url":"https://github.com/sclorg/postgresql-container","homepage":null,"size":243,"stargazers_count":44,"watchers_count":44,"language":"Shell","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":55,"mirror_url":null,"open_issues_count":24,"forks":55,"open_issues":24,"watchers":44,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/sclorg/postgresql-container/pulls/165"},"html":{"href":"https://github.com/sclorg/postgresql-container/pull/165"},"issue":{"href":"https://api.github.com/repos/sclorg/postgresql-container/issues/165"},"comments":{"href":"https://api.github.com/repos/sclorg/postgresql-container/issues/165/comments"},"review_comments":{"href":"https://api.github.com/repos/sclorg/postgresql-container/pulls/165/comments"},"review_comment":{"href":"https://api.github.com/repos/sclorg/postgresql-container/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/sclorg/postgresql-container/pulls/165/commits"},"statuses":{"href":"https://api.github.com/repos/sclorg/postgresql-container/statuses/316bfc37206b63aae9d56d3e4c470504846fa0f4"}}}}
{"actor":{"display_login":"praiskup"}}