{"action":"created","comment":{"url":"https://api.github.com/repos/aceleradora-TW/prescare/pulls/comments/193769466","pull_request_review_id":126809149,"id":193769466,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDE5Mzc2OTQ2Ng==","diff_hunk":"@@ -0,0 +1,52 @@\n+module.exports = models => () => {\n+  console.log('Seeding!')\n+  if(process.env.NODE_ENV && process.env.NODE_ENV === 'production') {\n+    return;\n+  }\n+\n+  models.Acolhido.findOrCreate({\n+    where: { nome: \"Josicleiso Dores\" },\n+    defaults: {\n+      nome: \"Josicleiso Dores\",\n+      idade: 12,\n+      rg: \"123456\",\n+      peso: 12.5,\n+      alergias: \"Paracetamol\",\n+      viaAlimentacao: \"Oral\"\n+    }\n+  }).spread((acolhido, created) => {\n+    if(!created) {\n+      return;\n+    }\n+\n+    models.Prescricao.create({","path":"seed.js","position":22,"original_position":22,"commit_id":"a38205ccf6dea664f003d37754a78119fef7d7c9","original_commit_id":"a38205ccf6dea664f003d37754a78119fef7d7c9","user":{"login":"othman853","id":4705127,"node_id":"MDQ6VXNlcjQ3MDUxMjc=","avatar_url":"https://avatars3.githubusercontent.com/u/4705127?v=4","gravatar_id":"","url":"https://api.github.com/users/othman853","html_url":"https://github.com/othman853","followers_url":"https://api.github.com/users/othman853/followers","following_url":"https://api.github.com/users/othman853/following{/other_user}","gists_url":"https://api.github.com/users/othman853/gists{/gist_id}","starred_url":"https://api.github.com/users/othman853/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/othman853/subscriptions","organizations_url":"https://api.github.com/users/othman853/orgs","repos_url":"https://api.github.com/users/othman853/repos","events_url":"https://api.github.com/users/othman853/events{/privacy}","received_events_url":"https://api.github.com/users/othman853/received_events","type":"User","site_admin":false},"body":"Não seria melhor fazer isso usando promises?\r\n\r\n```javascript\r\nmodels.Acolhido\r\n  .findOrCreate({})\r\n  .then(acolhido => models.Prescricao.create({}))\r\n  .then(prescricao => models.Medicamento.create({}))\r\n  .catch(error => console.log('Erro ao executar seeding', error))\r\n```\r\n\r\nExiste um motivo específico para usarmos `.spread`? O que isso faz?","created_at":"2018-06-07T14:34:36Z","updated_at":"2018-06-07T14:35:28Z","html_url":"https://github.com/aceleradora-TW/prescare/pull/33#discussion_r193769466","pull_request_url":"https://api.github.com/repos/aceleradora-TW/prescare/pulls/33","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/aceleradora-TW/prescare/pulls/comments/193769466"},"html":{"href":"https://github.com/aceleradora-TW/prescare/pull/33#discussion_r193769466"},"pull_request":{"href":"https://api.github.com/repos/aceleradora-TW/prescare/pulls/33"}}},"pull_request":{"url":"https://api.github.com/repos/aceleradora-TW/prescare/pulls/33","id":193341393,"node_id":"MDExOlB1bGxSZXF1ZXN0MTkzMzQxMzkz","html_url":"https://github.com/aceleradora-TW/prescare/pull/33","diff_url":"https://github.com/aceleradora-TW/prescare/pull/33.diff","patch_url":"https://github.com/aceleradora-TW/prescare/pull/33.patch","issue_url":"https://api.github.com/repos/aceleradora-TW/prescare/issues/33","number":33,"state":"open","locked":false,"title":"Criando seeds usando sequelize ao invés de SQL","user":{"login":"ghidorsi","id":15145105,"node_id":"MDQ6VXNlcjE1MTQ1MTA1","avatar_url":"https://avatars3.githubusercontent.com/u/15145105?v=4","gravatar_id":"","url":"https://api.github.com/users/ghidorsi","html_url":"https://github.com/ghidorsi","followers_url":"https://api.github.com/users/ghidorsi/followers","following_url":"https://api.github.com/users/ghidorsi/following{/other_user}","gists_url":"https://api.github.com/users/ghidorsi/gists{/gist_id}","starred_url":"https://api.github.com/users/ghidorsi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ghidorsi/subscriptions","organizations_url":"https://api.github.com/users/ghidorsi/orgs","repos_url":"https://api.github.com/users/ghidorsi/repos","events_url":"https://api.github.com/users/ghidorsi/events{/privacy}","received_events_url":"https://api.github.com/users/ghidorsi/received_events","type":"User","site_admin":false},"body":"","created_at":"2018-06-07T14:28:15Z","updated_at":"2018-06-07T14:35:28Z","closed_at":null,"merged_at":null,"merge_commit_sha":"6204d4d7103784a24a1b420df3c3d359bdb6d8c3","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/aceleradora-TW/prescare/pulls/33/commits","review_comments_url":"https://api.github.com/repos/aceleradora-TW/prescare/pulls/33/comments","review_comment_url":"https://api.github.com/repos/aceleradora-TW/prescare/pulls/comments{/number}","comments_url":"https://api.github.com/repos/aceleradora-TW/prescare/issues/33/comments","statuses_url":"https://api.github.com/repos/aceleradora-TW/prescare/statuses/a38205ccf6dea664f003d37754a78119fef7d7c9","head":{"label":"aceleradora-TW:gg-seed-sequelize","ref":"gg-seed-sequelize","sha":"a38205ccf6dea664f003d37754a78119fef7d7c9","user":{"login":"aceleradora-TW","id":18720656,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE4NzIwNjU2","avatar_url":"https://avatars0.githubusercontent.com/u/18720656?v=4","gravatar_id":"","url":"https://api.github.com/users/aceleradora-TW","html_url":"https://github.com/aceleradora-TW","followers_url":"https://api.github.com/users/aceleradora-TW/followers","following_url":"https://api.github.com/users/aceleradora-TW/following{/other_user}","gists_url":"https://api.github.com/users/aceleradora-TW/gists{/gist_id}","starred_url":"https://api.github.com/users/aceleradora-TW/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aceleradora-TW/subscriptions","organizations_url":"https://api.github.com/users/aceleradora-TW/orgs","repos_url":"https://api.github.com/users/aceleradora-TW/repos","events_url":"https://api.github.com/users/aceleradora-TW/events{/privacy}","received_events_url":"https://api.github.com/users/aceleradora-TW/received_events","type":"Organization","site_admin":false},"repo":{"id":131876032,"node_id":"MDEwOlJlcG9zaXRvcnkxMzE4NzYwMzI=","name":"prescare","full_name":"aceleradora-TW/prescare","owner":{"login":"aceleradora-TW","id":18720656,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE4NzIwNjU2","avatar_url":"https://avatars0.githubusercontent.com/u/18720656?v=4","gravatar_id":"","url":"https://api.github.com/users/aceleradora-TW","html_url":"https://github.com/aceleradora-TW","followers_url":"https://api.github.com/users/aceleradora-TW/followers","following_url":"https://api.github.com/users/aceleradora-TW/following{/other_user}","gists_url":"https://api.github.com/users/aceleradora-TW/gists{/gist_id}","starred_url":"https://api.github.com/users/aceleradora-TW/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aceleradora-TW/subscriptions","organizations_url":"https://api.github.com/users/aceleradora-TW/orgs","repos_url":"https://api.github.com/users/aceleradora-TW/repos","events_url":"https://api.github.com/users/aceleradora-TW/events{/privacy}","received_events_url":"https://api.github.com/users/aceleradora-TW/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/aceleradora-TW/prescare","description":"prescricao eletronica Menino Jesus de Praga","fork":false,"url":"https://api.github.com/repos/aceleradora-TW/prescare","forks_url":"https://api.github.com/repos/aceleradora-TW/prescare/forks","keys_url":"https://api.github.com/repos/aceleradora-TW/prescare/keys{/key_id}","collaborators_url":"https://api.github.com/repos/aceleradora-TW/prescare/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/aceleradora-TW/prescare/teams","hooks_url":"https://api.github.com/repos/aceleradora-TW/prescare/hooks","issue_events_url":"https://api.github.com/repos/aceleradora-TW/prescare/issues/events{/number}","events_url":"https://api.github.com/repos/aceleradora-TW/prescare/events","assignees_url":"https://api.github.com/repos/aceleradora-TW/prescare/assignees{/user}","branches_url":"https://api.github.com/repos/aceleradora-TW/prescare/branches{/branch}","tags_url":"https://api.github.com/repos/aceleradora-TW/prescare/tags","blobs_url":"https://api.github.com/repos/aceleradora-TW/prescare/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/aceleradora-TW/prescare/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/aceleradora-TW/prescare/git/refs{/sha}","trees_url":"https://api.github.com/repos/aceleradora-TW/prescare/git/trees{/sha}","statuses_url":"https://api.github.com/repos/aceleradora-TW/prescare/statuses/{sha}","languages_url":"https://api.github.com/repos/aceleradora-TW/prescare/languages","stargazers_url":"https://api.github.com/repos/aceleradora-TW/prescare/stargazers","contributors_url":"https://api.github.com/repos/aceleradora-TW/prescare/contributors","subscribers_url":"https://api.github.com/repos/aceleradora-TW/prescare/subscribers","subscription_url":"https://api.github.com/repos/aceleradora-TW/prescare/subscription","commits_url":"https://api.github.com/repos/aceleradora-TW/prescare/commits{/sha}","git_commits_url":"https://api.github.com/repos/aceleradora-TW/prescare/git/commits{/sha}","comments_url":"https://api.github.com/repos/aceleradora-TW/prescare/comments{/number}","issue_comment_url":"https://api.github.com/repos/aceleradora-TW/prescare/issues/comments{/number}","contents_url":"https://api.github.com/repos/aceleradora-TW/prescare/contents/{+path}","compare_url":"https://api.github.com/repos/aceleradora-TW/prescare/compare/{base}...{head}","merges_url":"https://api.github.com/repos/aceleradora-TW/prescare/merges","archive_url":"https://api.github.com/repos/aceleradora-TW/prescare/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/aceleradora-TW/prescare/downloads","issues_url":"https://api.github.com/repos/aceleradora-TW/prescare/issues{/number}","pulls_url":"https://api.github.com/repos/aceleradora-TW/prescare/pulls{/number}","milestones_url":"https://api.github.com/repos/aceleradora-TW/prescare/milestones{/number}","notifications_url":"https://api.github.com/repos/aceleradora-TW/prescare/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/aceleradora-TW/prescare/labels{/name}","releases_url":"https://api.github.com/repos/aceleradora-TW/prescare/releases{/id}","deployments_url":"https://api.github.com/repos/aceleradora-TW/prescare/deployments","created_at":"2018-05-02T16:13:09Z","updated_at":"2018-06-07T13:18:17Z","pushed_at":"2018-06-07T14:28:16Z","git_url":"git://github.com/aceleradora-TW/prescare.git","ssh_url":"git@github.com:aceleradora-TW/prescare.git","clone_url":"https://github.com/aceleradora-TW/prescare.git","svn_url":"https://github.com/aceleradora-TW/prescare","homepage":null,"size":1440,"stargazers_count":6,"watchers_count":6,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"archived":false,"open_issues_count":4,"license":null,"forks":1,"open_issues":4,"watchers":6,"default_branch":"master"}},"base":{"label":"aceleradora-TW:master","ref":"master","sha":"f82106b1b78dd66b3db9ad6f1586ea873694674b","user":{"login":"aceleradora-TW","id":18720656,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE4NzIwNjU2","avatar_url":"https://avatars0.githubusercontent.com/u/18720656?v=4","gravatar_id":"","url":"https://api.github.com/users/aceleradora-TW","html_url":"https://github.com/aceleradora-TW","followers_url":"https://api.github.com/users/aceleradora-TW/followers","following_url":"https://api.github.com/users/aceleradora-TW/following{/other_user}","gists_url":"https://api.github.com/users/aceleradora-TW/gists{/gist_id}","starred_url":"https://api.github.com/users/aceleradora-TW/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aceleradora-TW/subscriptions","organizations_url":"https://api.github.com/users/aceleradora-TW/orgs","repos_url":"https://api.github.com/users/aceleradora-TW/repos","events_url":"https://api.github.com/users/aceleradora-TW/events{/privacy}","received_events_url":"https://api.github.com/users/aceleradora-TW/received_events","type":"Organization","site_admin":false},"repo":{"id":131876032,"node_id":"MDEwOlJlcG9zaXRvcnkxMzE4NzYwMzI=","name":"prescare","full_name":"aceleradora-TW/prescare","owner":{"login":"aceleradora-TW","id":18720656,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE4NzIwNjU2","avatar_url":"https://avatars0.githubusercontent.com/u/18720656?v=4","gravatar_id":"","url":"https://api.github.com/users/aceleradora-TW","html_url":"https://github.com/aceleradora-TW","followers_url":"https://api.github.com/users/aceleradora-TW/followers","following_url":"https://api.github.com/users/aceleradora-TW/following{/other_user}","gists_url":"https://api.github.com/users/aceleradora-TW/gists{/gist_id}","starred_url":"https://api.github.com/users/aceleradora-TW/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aceleradora-TW/subscriptions","organizations_url":"https://api.github.com/users/aceleradora-TW/orgs","repos_url":"https://api.github.com/users/aceleradora-TW/repos","events_url":"https://api.github.com/users/aceleradora-TW/events{/privacy}","received_events_url":"https://api.github.com/users/aceleradora-TW/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/aceleradora-TW/prescare","description":"prescricao eletronica Menino Jesus de Praga","fork":false,"url":"https://api.github.com/repos/aceleradora-TW/prescare","forks_url":"https://api.github.com/repos/aceleradora-TW/prescare/forks","keys_url":"https://api.github.com/repos/aceleradora-TW/prescare/keys{/key_id}","collaborators_url":"https://api.github.com/repos/aceleradora-TW/prescare/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/aceleradora-TW/prescare/teams","hooks_url":"https://api.github.com/repos/aceleradora-TW/prescare/hooks","issue_events_url":"https://api.github.com/repos/aceleradora-TW/prescare/issues/events{/number}","events_url":"https://api.github.com/repos/aceleradora-TW/prescare/events","assignees_url":"https://api.github.com/repos/aceleradora-TW/prescare/assignees{/user}","branches_url":"https://api.github.com/repos/aceleradora-TW/prescare/branches{/branch}","tags_url":"https://api.github.com/repos/aceleradora-TW/prescare/tags","blobs_url":"https://api.github.com/repos/aceleradora-TW/prescare/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/aceleradora-TW/prescare/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/aceleradora-TW/prescare/git/refs{/sha}","trees_url":"https://api.github.com/repos/aceleradora-TW/prescare/git/trees{/sha}","statuses_url":"https://api.github.com/repos/aceleradora-TW/prescare/statuses/{sha}","languages_url":"https://api.github.com/repos/aceleradora-TW/prescare/languages","stargazers_url":"https://api.github.com/repos/aceleradora-TW/prescare/stargazers","contributors_url":"https://api.github.com/repos/aceleradora-TW/prescare/contributors","subscribers_url":"https://api.github.com/repos/aceleradora-TW/prescare/subscribers","subscription_url":"https://api.github.com/repos/aceleradora-TW/prescare/subscription","commits_url":"https://api.github.com/repos/aceleradora-TW/prescare/commits{/sha}","git_commits_url":"https://api.github.com/repos/aceleradora-TW/prescare/git/commits{/sha}","comments_url":"https://api.github.com/repos/aceleradora-TW/prescare/comments{/number}","issue_comment_url":"https://api.github.com/repos/aceleradora-TW/prescare/issues/comments{/number}","contents_url":"https://api.github.com/repos/aceleradora-TW/prescare/contents/{+path}","compare_url":"https://api.github.com/repos/aceleradora-TW/prescare/compare/{base}...{head}","merges_url":"https://api.github.com/repos/aceleradora-TW/prescare/merges","archive_url":"https://api.github.com/repos/aceleradora-TW/prescare/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/aceleradora-TW/prescare/downloads","issues_url":"https://api.github.com/repos/aceleradora-TW/prescare/issues{/number}","pulls_url":"https://api.github.com/repos/aceleradora-TW/prescare/pulls{/number}","milestones_url":"https://api.github.com/repos/aceleradora-TW/prescare/milestones{/number}","notifications_url":"https://api.github.com/repos/aceleradora-TW/prescare/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/aceleradora-TW/prescare/labels{/name}","releases_url":"https://api.github.com/repos/aceleradora-TW/prescare/releases{/id}","deployments_url":"https://api.github.com/repos/aceleradora-TW/prescare/deployments","created_at":"2018-05-02T16:13:09Z","updated_at":"2018-06-07T13:18:17Z","pushed_at":"2018-06-07T14:28:16Z","git_url":"git://github.com/aceleradora-TW/prescare.git","ssh_url":"git@github.com:aceleradora-TW/prescare.git","clone_url":"https://github.com/aceleradora-TW/prescare.git","svn_url":"https://github.com/aceleradora-TW/prescare","homepage":null,"size":1440,"stargazers_count":6,"watchers_count":6,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"archived":false,"open_issues_count":4,"license":null,"forks":1,"open_issues":4,"watchers":6,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/aceleradora-TW/prescare/pulls/33"},"html":{"href":"https://github.com/aceleradora-TW/prescare/pull/33"},"issue":{"href":"https://api.github.com/repos/aceleradora-TW/prescare/issues/33"},"comments":{"href":"https://api.github.com/repos/aceleradora-TW/prescare/issues/33/comments"},"review_comments":{"href":"https://api.github.com/repos/aceleradora-TW/prescare/pulls/33/comments"},"review_comment":{"href":"https://api.github.com/repos/aceleradora-TW/prescare/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/aceleradora-TW/prescare/pulls/33/commits"},"statuses":{"href":"https://api.github.com/repos/aceleradora-TW/prescare/statuses/a38205ccf6dea664f003d37754a78119fef7d7c9"}},"author_association":"MEMBER"}}
{"actor":{"display_login":"othman853"}}