{"action":"created","comment":{"url":"https://api.github.com/repos/andela/rivendell-ah/pulls/comments/204840248","pull_request_review_id":139993217,"id":204840248,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIwNDg0MDI0OA==","diff_hunk":"@@ -71,17 +70,33 @@ router.post(\"/users/login\", function(req, res, next) {\n });\n \n router.post(\"/users\", function(req, res, next) {\n-    const user = new User();\n+    // const user = new User();\n \n-    user.username = req.body.user.username;\n-    user.email = req.body.user.email;\n-    user.setPassword(req.body.user.password);\n+    // user.username = req.body.user.username;\n+    // user.email = req.body.user.email;\n+    // user.setPassword(req.body.user.password);\n+\n+    // user.save()\n+    //     .then(function() {\n+    //         return res.json({ user: user.toAuthJSON() });\n+    //     })\n+    //     .catch(next);\n+\n+    const username = req.body.username,\n+    email = req.body.email,\n+    hash= req.body.password;\n+\n+    User.create({ username, email, hash})\n+    .then(function(user){\n+        return res.status(201).json({ \n+            email: user.email,\n+            token: 'This feature is yet to be developed',\n+            username: user.username,\n+            bio: user.bio || `Hi ${user.username}, please update your profile`,\n+            image: user.image || `Don't forget to upload your profile image`,\n+        });\n+    }).catch(next);","path":"routes/api/users.js","position":42,"original_position":42,"commit_id":"220c514a9c671f07acc3b869b4bb4dd2f1b54a9e","original_commit_id":"220c514a9c671f07acc3b869b4bb4dd2f1b54a9e","user":{"login":"megame24","id":30550427,"node_id":"MDQ6VXNlcjMwNTUwNDI3","avatar_url":"https://avatars3.githubusercontent.com/u/30550427?v=4","gravatar_id":"","url":"https://api.github.com/users/megame24","html_url":"https://github.com/megame24","followers_url":"https://api.github.com/users/megame24/followers","following_url":"https://api.github.com/users/megame24/following{/other_user}","gists_url":"https://api.github.com/users/megame24/gists{/gist_id}","starred_url":"https://api.github.com/users/megame24/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/megame24/subscriptions","organizations_url":"https://api.github.com/users/megame24/orgs","repos_url":"https://api.github.com/users/megame24/repos","events_url":"https://api.github.com/users/megame24/events{/privacy}","received_events_url":"https://api.github.com/users/megame24/received_events","type":"User","site_admin":false},"body":"I believe your task/chore is to set up the application to use Postgres, can you explain what you are trying to achieve here?.","created_at":"2018-07-24T17:17:46Z","updated_at":"2018-07-24T17:17:46Z","html_url":"https://github.com/andela/rivendell-ah/pull/6#discussion_r204840248","pull_request_url":"https://api.github.com/repos/andela/rivendell-ah/pulls/6","author_association":"COLLABORATOR","_links":{"self":{"href":"https://api.github.com/repos/andela/rivendell-ah/pulls/comments/204840248"},"html":{"href":"https://github.com/andela/rivendell-ah/pull/6#discussion_r204840248"},"pull_request":{"href":"https://api.github.com/repos/andela/rivendell-ah/pulls/6"}}},"pull_request":{"url":"https://api.github.com/repos/andela/rivendell-ah/pulls/6","id":203563865,"node_id":"MDExOlB1bGxSZXF1ZXN0MjAzNTYzODY1","html_url":"https://github.com/andela/rivendell-ah/pull/6","diff_url":"https://github.com/andela/rivendell-ah/pull/6.diff","patch_url":"https://github.com/andela/rivendell-ah/pull/6.patch","issue_url":"https://api.github.com/repos/andela/rivendell-ah/issues/6","number":6,"state":"open","locked":false,"title":"#159204690 Configure Authors Haven to use PostgreSQL as DB Engine","user":{"login":"mppdg","id":39072402,"node_id":"MDQ6VXNlcjM5MDcyNDAy","avatar_url":"https://avatars2.githubusercontent.com/u/39072402?v=4","gravatar_id":"","url":"https://api.github.com/users/mppdg","html_url":"https://github.com/mppdg","followers_url":"https://api.github.com/users/mppdg/followers","following_url":"https://api.github.com/users/mppdg/following{/other_user}","gists_url":"https://api.github.com/users/mppdg/gists{/gist_id}","starred_url":"https://api.github.com/users/mppdg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mppdg/subscriptions","organizations_url":"https://api.github.com/users/mppdg/orgs","repos_url":"https://api.github.com/users/mppdg/repos","events_url":"https://api.github.com/users/mppdg/events{/privacy}","received_events_url":"https://api.github.com/users/mppdg/received_events","type":"User","site_admin":false},"body":"#### What does this PR do?\r\n- This PR configures the Authors Haven application to use PostgreSQL as DB Engine.\r\n#### Description of Task to be completed?\r\n- install dependencies that enable the app to interface with PostgreSQL database.\r\n- reconfigure the application to use Sequelize and PostgreSQL database.\r\n- create models and migrations to setup the database tables\r\n- Create relationships (associations) among tables\r\n#### How should this be manually tested?\r\n- start the application with `npm start` and use Postman to hit the registration endpoint `api/users`. \r\n\r\n#### Any background context you want to provide?\r\n-\r\n#### What are the relevant pivotal tracker stories?\r\n#159204690\r\n\r\n<img width=\"917\" alt=\"screen shot 2018-07-24 at 4 14 57 pm\" src=\"https://user-images.githubusercontent.com/39072402/43148427-22c64492-8f5d-11e8-8816-3b444ee21511.png\">\r\n","created_at":"2018-07-24T15:18:27Z","updated_at":"2018-07-24T17:17:46Z","closed_at":null,"merged_at":null,"merge_commit_sha":"357371c67fc17af9606c3e0c297e102cc421c5a6","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/andela/rivendell-ah/pulls/6/commits","review_comments_url":"https://api.github.com/repos/andela/rivendell-ah/pulls/6/comments","review_comment_url":"https://api.github.com/repos/andela/rivendell-ah/pulls/comments{/number}","comments_url":"https://api.github.com/repos/andela/rivendell-ah/issues/6/comments","statuses_url":"https://api.github.com/repos/andela/rivendell-ah/statuses/220c514a9c671f07acc3b869b4bb4dd2f1b54a9e","head":{"label":"andela:ch/159204690/setup-postgresql-database","ref":"ch/159204690/setup-postgresql-database","sha":"220c514a9c671f07acc3b869b4bb4dd2f1b54a9e","user":{"login":"andela","id":4100206,"node_id":"MDEyOk9yZ2FuaXphdGlvbjQxMDAyMDY=","avatar_url":"https://avatars2.githubusercontent.com/u/4100206?v=4","gravatar_id":"","url":"https://api.github.com/users/andela","html_url":"https://github.com/andela","followers_url":"https://api.github.com/users/andela/followers","following_url":"https://api.github.com/users/andela/following{/other_user}","gists_url":"https://api.github.com/users/andela/gists{/gist_id}","starred_url":"https://api.github.com/users/andela/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andela/subscriptions","organizations_url":"https://api.github.com/users/andela/orgs","repos_url":"https://api.github.com/users/andela/repos","events_url":"https://api.github.com/users/andela/events{/privacy}","received_events_url":"https://api.github.com/users/andela/received_events","type":"Organization","site_admin":false},"repo":{"id":141551362,"node_id":"MDEwOlJlcG9zaXRvcnkxNDE1NTEzNjI=","name":"rivendell-ah","full_name":"andela/rivendell-ah","owner":{"login":"andela","id":4100206,"node_id":"MDEyOk9yZ2FuaXphdGlvbjQxMDAyMDY=","avatar_url":"https://avatars2.githubusercontent.com/u/4100206?v=4","gravatar_id":"","url":"https://api.github.com/users/andela","html_url":"https://github.com/andela","followers_url":"https://api.github.com/users/andela/followers","following_url":"https://api.github.com/users/andela/following{/other_user}","gists_url":"https://api.github.com/users/andela/gists{/gist_id}","starred_url":"https://api.github.com/users/andela/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andela/subscriptions","organizations_url":"https://api.github.com/users/andela/orgs","repos_url":"https://api.github.com/users/andela/repos","events_url":"https://api.github.com/users/andela/events{/privacy}","received_events_url":"https://api.github.com/users/andela/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/andela/rivendell-ah","description":null,"fork":false,"url":"https://api.github.com/repos/andela/rivendell-ah","forks_url":"https://api.github.com/repos/andela/rivendell-ah/forks","keys_url":"https://api.github.com/repos/andela/rivendell-ah/keys{/key_id}","collaborators_url":"https://api.github.com/repos/andela/rivendell-ah/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/andela/rivendell-ah/teams","hooks_url":"https://api.github.com/repos/andela/rivendell-ah/hooks","issue_events_url":"https://api.github.com/repos/andela/rivendell-ah/issues/events{/number}","events_url":"https://api.github.com/repos/andela/rivendell-ah/events","assignees_url":"https://api.github.com/repos/andela/rivendell-ah/assignees{/user}","branches_url":"https://api.github.com/repos/andela/rivendell-ah/branches{/branch}","tags_url":"https://api.github.com/repos/andela/rivendell-ah/tags","blobs_url":"https://api.github.com/repos/andela/rivendell-ah/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/andela/rivendell-ah/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/andela/rivendell-ah/git/refs{/sha}","trees_url":"https://api.github.com/repos/andela/rivendell-ah/git/trees{/sha}","statuses_url":"https://api.github.com/repos/andela/rivendell-ah/statuses/{sha}","languages_url":"https://api.github.com/repos/andela/rivendell-ah/languages","stargazers_url":"https://api.github.com/repos/andela/rivendell-ah/stargazers","contributors_url":"https://api.github.com/repos/andela/rivendell-ah/contributors","subscribers_url":"https://api.github.com/repos/andela/rivendell-ah/subscribers","subscription_url":"https://api.github.com/repos/andela/rivendell-ah/subscription","commits_url":"https://api.github.com/repos/andela/rivendell-ah/commits{/sha}","git_commits_url":"https://api.github.com/repos/andela/rivendell-ah/git/commits{/sha}","comments_url":"https://api.github.com/repos/andela/rivendell-ah/comments{/number}","issue_comment_url":"https://api.github.com/repos/andela/rivendell-ah/issues/comments{/number}","contents_url":"https://api.github.com/repos/andela/rivendell-ah/contents/{+path}","compare_url":"https://api.github.com/repos/andela/rivendell-ah/compare/{base}...{head}","merges_url":"https://api.github.com/repos/andela/rivendell-ah/merges","archive_url":"https://api.github.com/repos/andela/rivendell-ah/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/andela/rivendell-ah/downloads","issues_url":"https://api.github.com/repos/andela/rivendell-ah/issues{/number}","pulls_url":"https://api.github.com/repos/andela/rivendell-ah/pulls{/number}","milestones_url":"https://api.github.com/repos/andela/rivendell-ah/milestones{/number}","notifications_url":"https://api.github.com/repos/andela/rivendell-ah/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/andela/rivendell-ah/labels{/name}","releases_url":"https://api.github.com/repos/andela/rivendell-ah/releases{/id}","deployments_url":"https://api.github.com/repos/andela/rivendell-ah/deployments","created_at":"2018-07-19T08:51:46Z","updated_at":"2018-07-24T10:54:42Z","pushed_at":"2018-07-24T15:18:28Z","git_url":"git://github.com/andela/rivendell-ah.git","ssh_url":"git@github.com:andela/rivendell-ah.git","clone_url":"https://github.com/andela/rivendell-ah.git","svn_url":"https://github.com/andela/rivendell-ah","homepage":null,"size":34,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":1,"license":null,"forks":0,"open_issues":1,"watchers":0,"default_branch":"staging"}},"base":{"label":"andela:staging","ref":"staging","sha":"bcc543c859914d0c6293be4b0fcd05385db45152","user":{"login":"andela","id":4100206,"node_id":"MDEyOk9yZ2FuaXphdGlvbjQxMDAyMDY=","avatar_url":"https://avatars2.githubusercontent.com/u/4100206?v=4","gravatar_id":"","url":"https://api.github.com/users/andela","html_url":"https://github.com/andela","followers_url":"https://api.github.com/users/andela/followers","following_url":"https://api.github.com/users/andela/following{/other_user}","gists_url":"https://api.github.com/users/andela/gists{/gist_id}","starred_url":"https://api.github.com/users/andela/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andela/subscriptions","organizations_url":"https://api.github.com/users/andela/orgs","repos_url":"https://api.github.com/users/andela/repos","events_url":"https://api.github.com/users/andela/events{/privacy}","received_events_url":"https://api.github.com/users/andela/received_events","type":"Organization","site_admin":false},"repo":{"id":141551362,"node_id":"MDEwOlJlcG9zaXRvcnkxNDE1NTEzNjI=","name":"rivendell-ah","full_name":"andela/rivendell-ah","owner":{"login":"andela","id":4100206,"node_id":"MDEyOk9yZ2FuaXphdGlvbjQxMDAyMDY=","avatar_url":"https://avatars2.githubusercontent.com/u/4100206?v=4","gravatar_id":"","url":"https://api.github.com/users/andela","html_url":"https://github.com/andela","followers_url":"https://api.github.com/users/andela/followers","following_url":"https://api.github.com/users/andela/following{/other_user}","gists_url":"https://api.github.com/users/andela/gists{/gist_id}","starred_url":"https://api.github.com/users/andela/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andela/subscriptions","organizations_url":"https://api.github.com/users/andela/orgs","repos_url":"https://api.github.com/users/andela/repos","events_url":"https://api.github.com/users/andela/events{/privacy}","received_events_url":"https://api.github.com/users/andela/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/andela/rivendell-ah","description":null,"fork":false,"url":"https://api.github.com/repos/andela/rivendell-ah","forks_url":"https://api.github.com/repos/andela/rivendell-ah/forks","keys_url":"https://api.github.com/repos/andela/rivendell-ah/keys{/key_id}","collaborators_url":"https://api.github.com/repos/andela/rivendell-ah/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/andela/rivendell-ah/teams","hooks_url":"https://api.github.com/repos/andela/rivendell-ah/hooks","issue_events_url":"https://api.github.com/repos/andela/rivendell-ah/issues/events{/number}","events_url":"https://api.github.com/repos/andela/rivendell-ah/events","assignees_url":"https://api.github.com/repos/andela/rivendell-ah/assignees{/user}","branches_url":"https://api.github.com/repos/andela/rivendell-ah/branches{/branch}","tags_url":"https://api.github.com/repos/andela/rivendell-ah/tags","blobs_url":"https://api.github.com/repos/andela/rivendell-ah/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/andela/rivendell-ah/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/andela/rivendell-ah/git/refs{/sha}","trees_url":"https://api.github.com/repos/andela/rivendell-ah/git/trees{/sha}","statuses_url":"https://api.github.com/repos/andela/rivendell-ah/statuses/{sha}","languages_url":"https://api.github.com/repos/andela/rivendell-ah/languages","stargazers_url":"https://api.github.com/repos/andela/rivendell-ah/stargazers","contributors_url":"https://api.github.com/repos/andela/rivendell-ah/contributors","subscribers_url":"https://api.github.com/repos/andela/rivendell-ah/subscribers","subscription_url":"https://api.github.com/repos/andela/rivendell-ah/subscription","commits_url":"https://api.github.com/repos/andela/rivendell-ah/commits{/sha}","git_commits_url":"https://api.github.com/repos/andela/rivendell-ah/git/commits{/sha}","comments_url":"https://api.github.com/repos/andela/rivendell-ah/comments{/number}","issue_comment_url":"https://api.github.com/repos/andela/rivendell-ah/issues/comments{/number}","contents_url":"https://api.github.com/repos/andela/rivendell-ah/contents/{+path}","compare_url":"https://api.github.com/repos/andela/rivendell-ah/compare/{base}...{head}","merges_url":"https://api.github.com/repos/andela/rivendell-ah/merges","archive_url":"https://api.github.com/repos/andela/rivendell-ah/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/andela/rivendell-ah/downloads","issues_url":"https://api.github.com/repos/andela/rivendell-ah/issues{/number}","pulls_url":"https://api.github.com/repos/andela/rivendell-ah/pulls{/number}","milestones_url":"https://api.github.com/repos/andela/rivendell-ah/milestones{/number}","notifications_url":"https://api.github.com/repos/andela/rivendell-ah/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/andela/rivendell-ah/labels{/name}","releases_url":"https://api.github.com/repos/andela/rivendell-ah/releases{/id}","deployments_url":"https://api.github.com/repos/andela/rivendell-ah/deployments","created_at":"2018-07-19T08:51:46Z","updated_at":"2018-07-24T10:54:42Z","pushed_at":"2018-07-24T15:18:28Z","git_url":"git://github.com/andela/rivendell-ah.git","ssh_url":"git@github.com:andela/rivendell-ah.git","clone_url":"https://github.com/andela/rivendell-ah.git","svn_url":"https://github.com/andela/rivendell-ah","homepage":null,"size":34,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":1,"license":null,"forks":0,"open_issues":1,"watchers":0,"default_branch":"staging"}},"_links":{"self":{"href":"https://api.github.com/repos/andela/rivendell-ah/pulls/6"},"html":{"href":"https://github.com/andela/rivendell-ah/pull/6"},"issue":{"href":"https://api.github.com/repos/andela/rivendell-ah/issues/6"},"comments":{"href":"https://api.github.com/repos/andela/rivendell-ah/issues/6/comments"},"review_comments":{"href":"https://api.github.com/repos/andela/rivendell-ah/pulls/6/comments"},"review_comment":{"href":"https://api.github.com/repos/andela/rivendell-ah/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/andela/rivendell-ah/pulls/6/commits"},"statuses":{"href":"https://api.github.com/repos/andela/rivendell-ah/statuses/220c514a9c671f07acc3b869b4bb4dd2f1b54a9e"}},"author_association":"COLLABORATOR"}}
{"actor":{"display_login":"megame24"}}