{"action":"created","comment":{"url":"https://api.github.com/repos/nearform/labs-authorization/pulls/comments/96601527","pull_request_review_id":17181064,"id":96601527,"diff_hunk":"@@ -0,0 +1,77 @@\n+'use strict'\n+\n+const _ = require('lodash')\n+const async = require('async')\n+const pg = require('pg')\n+const config = require('./../src/lib/config')\n+\n+if (config.get('env') !== 'test') {","path":"database/init.js","position":8,"original_position":8,"commit_id":"bba948a94b75f29717858ec673cb3b24dff1e1cc","original_commit_id":"bba948a94b75f29717858ec673cb3b24dff1e1cc","user":{"login":"mihaidma","id":4950500,"avatar_url":"https://avatars.githubusercontent.com/u/4950500?v=3","gravatar_id":"","url":"https://api.github.com/users/mihaidma","html_url":"https://github.com/mihaidma","followers_url":"https://api.github.com/users/mihaidma/followers","following_url":"https://api.github.com/users/mihaidma/following{/other_user}","gists_url":"https://api.github.com/users/mihaidma/gists{/gist_id}","starred_url":"https://api.github.com/users/mihaidma/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mihaidma/subscriptions","organizations_url":"https://api.github.com/users/mihaidma/orgs","repos_url":"https://api.github.com/users/mihaidma/repos","events_url":"https://api.github.com/users/mihaidma/events{/privacy}","received_events_url":"https://api.github.com/users/mihaidma/received_events","type":"User","site_admin":false},"body":"good idea but I think also saw an issue here: should be `process.env.NODE_ENV`? ","created_at":"2017-01-18T10:13:06Z","updated_at":"2017-01-18T10:15:35Z","html_url":"https://github.com/nearform/labs-authorization/pull/291#discussion_r96601527","pull_request_url":"https://api.github.com/repos/nearform/labs-authorization/pulls/291","_links":{"self":{"href":"https://api.github.com/repos/nearform/labs-authorization/pulls/comments/96601527"},"html":{"href":"https://github.com/nearform/labs-authorization/pull/291#discussion_r96601527"},"pull_request":{"href":"https://api.github.com/repos/nearform/labs-authorization/pulls/291"}}},"pull_request":{"url":"https://api.github.com/repos/nearform/labs-authorization/pulls/291","id":102018738,"html_url":"https://github.com/nearform/labs-authorization/pull/291","diff_url":"https://github.com/nearform/labs-authorization/pull/291.diff","patch_url":"https://github.com/nearform/labs-authorization/pull/291.patch","issue_url":"https://api.github.com/repos/nearform/labs-authorization/issues/291","number":291,"state":"open","locked":false,"title":"Issue 282 db migration","user":{"login":"p16","id":272483,"avatar_url":"https://avatars.githubusercontent.com/u/272483?v=3","gravatar_id":"","url":"https://api.github.com/users/p16","html_url":"https://github.com/p16","followers_url":"https://api.github.com/users/p16/followers","following_url":"https://api.github.com/users/p16/following{/other_user}","gists_url":"https://api.github.com/users/p16/gists{/gist_id}","starred_url":"https://api.github.com/users/p16/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/p16/subscriptions","organizations_url":"https://api.github.com/users/p16/orgs","repos_url":"https://api.github.com/users/p16/repos","events_url":"https://api.github.com/users/p16/events{/privacy}","received_events_url":"https://api.github.com/users/p16/received_events","type":"User","site_admin":false},"body":"This PR changes the following:\r\n\r\n* Add migration script that can be [run from terminal](https://github.com/nearform/labs-authorization/pull/291/files#diff-04c6e90faac2675aa89e2176d2eec7d8R68)\r\n* Add [`id` and `organizationId` to the policy file format](https://github.com/nearform/labs-authorization/tree/issue-282-db-migration#load-policies-from-file) for loading policies in batch\r\n* Extract a [module for loading policies in batch](https://github.com/nearform/labs-authorization/pull/291/files#diff-ae692cbbb46290caece6c72c4eb488e5R1) to be used also for the fixtures\r\n* Refactor [init db](https://github.com/nearform/labs-authorization/pull/291/files#diff-50d7b924fb0a220083d76976d647ea9cR1) and [load-test-data](https://github.com/nearform/labs-authorization/pull/291/files#diff-ab9f7ba712bc171e2985d2afbbbc09e6R1) scripts to remove dependency on external tools (docker, psql)\r\n* Prevent the init db  and the load-test-data script from running if the environment is not the `test`one ([see](https://github.com/nearform/labs-authorization/pull/291/files#diff-ab9f7ba712bc171e2985d2afbbbc09e6R11) and [see](https://github.com/nearform/labs-authorization/pull/291/files#diff-50d7b924fb0a220083d76976d647ea9cR8))","created_at":"2017-01-18T08:26:45Z","updated_at":"2017-01-18T10:15:35Z","closed_at":null,"merged_at":null,"merge_commit_sha":"744a7f6090ee42a991127b7dd9d9ce8cca82057c","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/nearform/labs-authorization/pulls/291/commits","review_comments_url":"https://api.github.com/repos/nearform/labs-authorization/pulls/291/comments","review_comment_url":"https://api.github.com/repos/nearform/labs-authorization/pulls/comments{/number}","comments_url":"https://api.github.com/repos/nearform/labs-authorization/issues/291/comments","statuses_url":"https://api.github.com/repos/nearform/labs-authorization/statuses/bba948a94b75f29717858ec673cb3b24dff1e1cc","head":{"label":"nearform:issue-282-db-migration","ref":"issue-282-db-migration","sha":"bba948a94b75f29717858ec673cb3b24dff1e1cc","user":{"login":"nearform","id":1544687,"avatar_url":"https://avatars.githubusercontent.com/u/1544687?v=3","gravatar_id":"","url":"https://api.github.com/users/nearform","html_url":"https://github.com/nearform","followers_url":"https://api.github.com/users/nearform/followers","following_url":"https://api.github.com/users/nearform/following{/other_user}","gists_url":"https://api.github.com/users/nearform/gists{/gist_id}","starred_url":"https://api.github.com/users/nearform/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nearform/subscriptions","organizations_url":"https://api.github.com/users/nearform/orgs","repos_url":"https://api.github.com/users/nearform/repos","events_url":"https://api.github.com/users/nearform/events{/privacy}","received_events_url":"https://api.github.com/users/nearform/received_events","type":"Organization","site_admin":false},"repo":{"id":70055917,"name":"labs-authorization","full_name":"nearform/labs-authorization","owner":{"login":"nearform","id":1544687,"avatar_url":"https://avatars.githubusercontent.com/u/1544687?v=3","gravatar_id":"","url":"https://api.github.com/users/nearform","html_url":"https://github.com/nearform","followers_url":"https://api.github.com/users/nearform/followers","following_url":"https://api.github.com/users/nearform/following{/other_user}","gists_url":"https://api.github.com/users/nearform/gists{/gist_id}","starred_url":"https://api.github.com/users/nearform/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nearform/subscriptions","organizations_url":"https://api.github.com/users/nearform/orgs","repos_url":"https://api.github.com/users/nearform/repos","events_url":"https://api.github.com/users/nearform/events{/privacy}","received_events_url":"https://api.github.com/users/nearform/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/nearform/labs-authorization","description":null,"fork":false,"url":"https://api.github.com/repos/nearform/labs-authorization","forks_url":"https://api.github.com/repos/nearform/labs-authorization/forks","keys_url":"https://api.github.com/repos/nearform/labs-authorization/keys{/key_id}","collaborators_url":"https://api.github.com/repos/nearform/labs-authorization/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/nearform/labs-authorization/teams","hooks_url":"https://api.github.com/repos/nearform/labs-authorization/hooks","issue_events_url":"https://api.github.com/repos/nearform/labs-authorization/issues/events{/number}","events_url":"https://api.github.com/repos/nearform/labs-authorization/events","assignees_url":"https://api.github.com/repos/nearform/labs-authorization/assignees{/user}","branches_url":"https://api.github.com/repos/nearform/labs-authorization/branches{/branch}","tags_url":"https://api.github.com/repos/nearform/labs-authorization/tags","blobs_url":"https://api.github.com/repos/nearform/labs-authorization/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/nearform/labs-authorization/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/nearform/labs-authorization/git/refs{/sha}","trees_url":"https://api.github.com/repos/nearform/labs-authorization/git/trees{/sha}","statuses_url":"https://api.github.com/repos/nearform/labs-authorization/statuses/{sha}","languages_url":"https://api.github.com/repos/nearform/labs-authorization/languages","stargazers_url":"https://api.github.com/repos/nearform/labs-authorization/stargazers","contributors_url":"https://api.github.com/repos/nearform/labs-authorization/contributors","subscribers_url":"https://api.github.com/repos/nearform/labs-authorization/subscribers","subscription_url":"https://api.github.com/repos/nearform/labs-authorization/subscription","commits_url":"https://api.github.com/repos/nearform/labs-authorization/commits{/sha}","git_commits_url":"https://api.github.com/repos/nearform/labs-authorization/git/commits{/sha}","comments_url":"https://api.github.com/repos/nearform/labs-authorization/comments{/number}","issue_comment_url":"https://api.github.com/repos/nearform/labs-authorization/issues/comments{/number}","contents_url":"https://api.github.com/repos/nearform/labs-authorization/contents/{+path}","compare_url":"https://api.github.com/repos/nearform/labs-authorization/compare/{base}...{head}","merges_url":"https://api.github.com/repos/nearform/labs-authorization/merges","archive_url":"https://api.github.com/repos/nearform/labs-authorization/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/nearform/labs-authorization/downloads","issues_url":"https://api.github.com/repos/nearform/labs-authorization/issues{/number}","pulls_url":"https://api.github.com/repos/nearform/labs-authorization/pulls{/number}","milestones_url":"https://api.github.com/repos/nearform/labs-authorization/milestones{/number}","notifications_url":"https://api.github.com/repos/nearform/labs-authorization/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/nearform/labs-authorization/labels{/name}","releases_url":"https://api.github.com/repos/nearform/labs-authorization/releases{/id}","deployments_url":"https://api.github.com/repos/nearform/labs-authorization/deployments","created_at":"2016-10-05T11:55:56Z","updated_at":"2017-01-18T09:10:09Z","pushed_at":"2017-01-18T10:08:12Z","git_url":"git://github.com/nearform/labs-authorization.git","ssh_url":"git@github.com:nearform/labs-authorization.git","clone_url":"https://github.com/nearform/labs-authorization.git","svn_url":"https://github.com/nearform/labs-authorization","homepage":null,"size":20049,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":51,"forks":0,"open_issues":51,"watchers":0,"default_branch":"master"}},"base":{"label":"nearform:master","ref":"master","sha":"bfd95a073752b643f81ec419c1bde0d454fe40d5","user":{"login":"nearform","id":1544687,"avatar_url":"https://avatars.githubusercontent.com/u/1544687?v=3","gravatar_id":"","url":"https://api.github.com/users/nearform","html_url":"https://github.com/nearform","followers_url":"https://api.github.com/users/nearform/followers","following_url":"https://api.github.com/users/nearform/following{/other_user}","gists_url":"https://api.github.com/users/nearform/gists{/gist_id}","starred_url":"https://api.github.com/users/nearform/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nearform/subscriptions","organizations_url":"https://api.github.com/users/nearform/orgs","repos_url":"https://api.github.com/users/nearform/repos","events_url":"https://api.github.com/users/nearform/events{/privacy}","received_events_url":"https://api.github.com/users/nearform/received_events","type":"Organization","site_admin":false},"repo":{"id":70055917,"name":"labs-authorization","full_name":"nearform/labs-authorization","owner":{"login":"nearform","id":1544687,"avatar_url":"https://avatars.githubusercontent.com/u/1544687?v=3","gravatar_id":"","url":"https://api.github.com/users/nearform","html_url":"https://github.com/nearform","followers_url":"https://api.github.com/users/nearform/followers","following_url":"https://api.github.com/users/nearform/following{/other_user}","gists_url":"https://api.github.com/users/nearform/gists{/gist_id}","starred_url":"https://api.github.com/users/nearform/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nearform/subscriptions","organizations_url":"https://api.github.com/users/nearform/orgs","repos_url":"https://api.github.com/users/nearform/repos","events_url":"https://api.github.com/users/nearform/events{/privacy}","received_events_url":"https://api.github.com/users/nearform/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/nearform/labs-authorization","description":null,"fork":false,"url":"https://api.github.com/repos/nearform/labs-authorization","forks_url":"https://api.github.com/repos/nearform/labs-authorization/forks","keys_url":"https://api.github.com/repos/nearform/labs-authorization/keys{/key_id}","collaborators_url":"https://api.github.com/repos/nearform/labs-authorization/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/nearform/labs-authorization/teams","hooks_url":"https://api.github.com/repos/nearform/labs-authorization/hooks","issue_events_url":"https://api.github.com/repos/nearform/labs-authorization/issues/events{/number}","events_url":"https://api.github.com/repos/nearform/labs-authorization/events","assignees_url":"https://api.github.com/repos/nearform/labs-authorization/assignees{/user}","branches_url":"https://api.github.com/repos/nearform/labs-authorization/branches{/branch}","tags_url":"https://api.github.com/repos/nearform/labs-authorization/tags","blobs_url":"https://api.github.com/repos/nearform/labs-authorization/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/nearform/labs-authorization/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/nearform/labs-authorization/git/refs{/sha}","trees_url":"https://api.github.com/repos/nearform/labs-authorization/git/trees{/sha}","statuses_url":"https://api.github.com/repos/nearform/labs-authorization/statuses/{sha}","languages_url":"https://api.github.com/repos/nearform/labs-authorization/languages","stargazers_url":"https://api.github.com/repos/nearform/labs-authorization/stargazers","contributors_url":"https://api.github.com/repos/nearform/labs-authorization/contributors","subscribers_url":"https://api.github.com/repos/nearform/labs-authorization/subscribers","subscription_url":"https://api.github.com/repos/nearform/labs-authorization/subscription","commits_url":"https://api.github.com/repos/nearform/labs-authorization/commits{/sha}","git_commits_url":"https://api.github.com/repos/nearform/labs-authorization/git/commits{/sha}","comments_url":"https://api.github.com/repos/nearform/labs-authorization/comments{/number}","issue_comment_url":"https://api.github.com/repos/nearform/labs-authorization/issues/comments{/number}","contents_url":"https://api.github.com/repos/nearform/labs-authorization/contents/{+path}","compare_url":"https://api.github.com/repos/nearform/labs-authorization/compare/{base}...{head}","merges_url":"https://api.github.com/repos/nearform/labs-authorization/merges","archive_url":"https://api.github.com/repos/nearform/labs-authorization/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/nearform/labs-authorization/downloads","issues_url":"https://api.github.com/repos/nearform/labs-authorization/issues{/number}","pulls_url":"https://api.github.com/repos/nearform/labs-authorization/pulls{/number}","milestones_url":"https://api.github.com/repos/nearform/labs-authorization/milestones{/number}","notifications_url":"https://api.github.com/repos/nearform/labs-authorization/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/nearform/labs-authorization/labels{/name}","releases_url":"https://api.github.com/repos/nearform/labs-authorization/releases{/id}","deployments_url":"https://api.github.com/repos/nearform/labs-authorization/deployments","created_at":"2016-10-05T11:55:56Z","updated_at":"2017-01-18T09:10:09Z","pushed_at":"2017-01-18T10:08:12Z","git_url":"git://github.com/nearform/labs-authorization.git","ssh_url":"git@github.com:nearform/labs-authorization.git","clone_url":"https://github.com/nearform/labs-authorization.git","svn_url":"https://github.com/nearform/labs-authorization","homepage":null,"size":20049,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":51,"forks":0,"open_issues":51,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/nearform/labs-authorization/pulls/291"},"html":{"href":"https://github.com/nearform/labs-authorization/pull/291"},"issue":{"href":"https://api.github.com/repos/nearform/labs-authorization/issues/291"},"comments":{"href":"https://api.github.com/repos/nearform/labs-authorization/issues/291/comments"},"review_comments":{"href":"https://api.github.com/repos/nearform/labs-authorization/pulls/291/comments"},"review_comment":{"href":"https://api.github.com/repos/nearform/labs-authorization/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/nearform/labs-authorization/pulls/291/commits"},"statuses":{"href":"https://api.github.com/repos/nearform/labs-authorization/statuses/bba948a94b75f29717858ec673cb3b24dff1e1cc"}}}}
{"actor":{"display_login":"mihaidma"}}