{"action":"created","comment":{"url":"https://api.github.com/repos/endfire/webcom-server/pulls/comments/68794663","id":68794663,"diff_hunk":"@@ -0,0 +1,62 @@\n+/* eslint-disable no-param-reassign */\n+import schemas from '../../schemas';\n+import relationshipFinder from '../utils/relationshipFinder';\n+import patch from '../utils/patchRelationship';\n+\n+const promise = [];\n+\n+const traverseDelete = (record, table, schema) => {\n+  if (!record.meta) return;\n+  record.meta.archived = true;\n+\n+  const relationships = relationshipFinder(table, schema);\n+\n+  for (const link of relationships) {\n+    if (link.table === table) {\n+      return;","path":"src/services/database/cascadeDelete.js","position":16,"original_position":16,"commit_id":"c88e3198d423c0bd8df97ea8a0baf03069bbda1d","original_commit_id":"c88e3198d423c0bd8df97ea8a0baf03069bbda1d","user":{"login":"dylnslck","id":6382973,"avatar_url":"https://avatars.githubusercontent.com/u/6382973?v=3","gravatar_id":"","url":"https://api.github.com/users/dylnslck","html_url":"https://github.com/dylnslck","followers_url":"https://api.github.com/users/dylnslck/followers","following_url":"https://api.github.com/users/dylnslck/following{/other_user}","gists_url":"https://api.github.com/users/dylnslck/gists{/gist_id}","starred_url":"https://api.github.com/users/dylnslck/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dylnslck/subscriptions","organizations_url":"https://api.github.com/users/dylnslck/orgs","repos_url":"https://api.github.com/users/dylnslck/repos","events_url":"https://api.github.com/users/dylnslck/events{/privacy}","received_events_url":"https://api.github.com/users/dylnslck/received_events","type":"User","site_admin":false},"body":"If you're going to `return` immediately, don't place it above an `else if`. Short circuit it immediately: \r\n\r\n```\r\nif (!('link' in table')) return;\r\n```\r\n\r\nThat way the indentations don't get too insane, and curly braces are hard on the eyes.","created_at":"2016-06-28T16:42:21Z","updated_at":"2016-06-28T16:42:21Z","html_url":"https://github.com/endfire/webcom-server/pull/28#discussion_r68794663","pull_request_url":"https://api.github.com/repos/endfire/webcom-server/pulls/28","_links":{"self":{"href":"https://api.github.com/repos/endfire/webcom-server/pulls/comments/68794663"},"html":{"href":"https://github.com/endfire/webcom-server/pull/28#discussion_r68794663"},"pull_request":{"href":"https://api.github.com/repos/endfire/webcom-server/pulls/28"}}},"pull_request":{"url":"https://api.github.com/repos/endfire/webcom-server/pulls/28","id":75483848,"html_url":"https://github.com/endfire/webcom-server/pull/28","diff_url":"https://github.com/endfire/webcom-server/pull/28.diff","patch_url":"https://github.com/endfire/webcom-server/pull/28.patch","issue_url":"https://api.github.com/repos/endfire/webcom-server/issues/28","number":28,"state":"open","locked":false,"title":"Add cascade delete and update for services","user":{"login":"calvinbrewer","id":10352306,"avatar_url":"https://avatars.githubusercontent.com/u/10352306?v=3","gravatar_id":"","url":"https://api.github.com/users/calvinbrewer","html_url":"https://github.com/calvinbrewer","followers_url":"https://api.github.com/users/calvinbrewer/followers","following_url":"https://api.github.com/users/calvinbrewer/following{/other_user}","gists_url":"https://api.github.com/users/calvinbrewer/gists{/gist_id}","starred_url":"https://api.github.com/users/calvinbrewer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/calvinbrewer/subscriptions","organizations_url":"https://api.github.com/users/calvinbrewer/orgs","repos_url":"https://api.github.com/users/calvinbrewer/repos","events_url":"https://api.github.com/users/calvinbrewer/events{/privacy}","received_events_url":"https://api.github.com/users/calvinbrewer/received_events","type":"User","site_admin":false},"body":"","created_at":"2016-06-28T14:10:24Z","updated_at":"2016-06-28T16:42:21Z","closed_at":null,"merged_at":null,"merge_commit_sha":"620dfff238e7931d37d569c3e6947fe80dac151a","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/endfire/webcom-server/pulls/28/commits","review_comments_url":"https://api.github.com/repos/endfire/webcom-server/pulls/28/comments","review_comment_url":"https://api.github.com/repos/endfire/webcom-server/pulls/comments{/number}","comments_url":"https://api.github.com/repos/endfire/webcom-server/issues/28/comments","statuses_url":"https://api.github.com/repos/endfire/webcom-server/statuses/c88e3198d423c0bd8df97ea8a0baf03069bbda1d","head":{"label":"endfire:services-cascade","ref":"services-cascade","sha":"c88e3198d423c0bd8df97ea8a0baf03069bbda1d","user":{"login":"endfire","id":13508451,"avatar_url":"https://avatars.githubusercontent.com/u/13508451?v=3","gravatar_id":"","url":"https://api.github.com/users/endfire","html_url":"https://github.com/endfire","followers_url":"https://api.github.com/users/endfire/followers","following_url":"https://api.github.com/users/endfire/following{/other_user}","gists_url":"https://api.github.com/users/endfire/gists{/gist_id}","starred_url":"https://api.github.com/users/endfire/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/endfire/subscriptions","organizations_url":"https://api.github.com/users/endfire/orgs","repos_url":"https://api.github.com/users/endfire/repos","events_url":"https://api.github.com/users/endfire/events{/privacy}","received_events_url":"https://api.github.com/users/endfire/received_events","type":"Organization","site_admin":false},"repo":{"id":61068885,"name":"webcom-server","full_name":"endfire/webcom-server","owner":{"login":"endfire","id":13508451,"avatar_url":"https://avatars.githubusercontent.com/u/13508451?v=3","gravatar_id":"","url":"https://api.github.com/users/endfire","html_url":"https://github.com/endfire","followers_url":"https://api.github.com/users/endfire/followers","following_url":"https://api.github.com/users/endfire/following{/other_user}","gists_url":"https://api.github.com/users/endfire/gists{/gist_id}","starred_url":"https://api.github.com/users/endfire/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/endfire/subscriptions","organizations_url":"https://api.github.com/users/endfire/orgs","repos_url":"https://api.github.com/users/endfire/repos","events_url":"https://api.github.com/users/endfire/events{/privacy}","received_events_url":"https://api.github.com/users/endfire/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/endfire/webcom-server","description":"Webcom's backend.","fork":false,"url":"https://api.github.com/repos/endfire/webcom-server","forks_url":"https://api.github.com/repos/endfire/webcom-server/forks","keys_url":"https://api.github.com/repos/endfire/webcom-server/keys{/key_id}","collaborators_url":"https://api.github.com/repos/endfire/webcom-server/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/endfire/webcom-server/teams","hooks_url":"https://api.github.com/repos/endfire/webcom-server/hooks","issue_events_url":"https://api.github.com/repos/endfire/webcom-server/issues/events{/number}","events_url":"https://api.github.com/repos/endfire/webcom-server/events","assignees_url":"https://api.github.com/repos/endfire/webcom-server/assignees{/user}","branches_url":"https://api.github.com/repos/endfire/webcom-server/branches{/branch}","tags_url":"https://api.github.com/repos/endfire/webcom-server/tags","blobs_url":"https://api.github.com/repos/endfire/webcom-server/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/endfire/webcom-server/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/endfire/webcom-server/git/refs{/sha}","trees_url":"https://api.github.com/repos/endfire/webcom-server/git/trees{/sha}","statuses_url":"https://api.github.com/repos/endfire/webcom-server/statuses/{sha}","languages_url":"https://api.github.com/repos/endfire/webcom-server/languages","stargazers_url":"https://api.github.com/repos/endfire/webcom-server/stargazers","contributors_url":"https://api.github.com/repos/endfire/webcom-server/contributors","subscribers_url":"https://api.github.com/repos/endfire/webcom-server/subscribers","subscription_url":"https://api.github.com/repos/endfire/webcom-server/subscription","commits_url":"https://api.github.com/repos/endfire/webcom-server/commits{/sha}","git_commits_url":"https://api.github.com/repos/endfire/webcom-server/git/commits{/sha}","comments_url":"https://api.github.com/repos/endfire/webcom-server/comments{/number}","issue_comment_url":"https://api.github.com/repos/endfire/webcom-server/issues/comments{/number}","contents_url":"https://api.github.com/repos/endfire/webcom-server/contents/{+path}","compare_url":"https://api.github.com/repos/endfire/webcom-server/compare/{base}...{head}","merges_url":"https://api.github.com/repos/endfire/webcom-server/merges","archive_url":"https://api.github.com/repos/endfire/webcom-server/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/endfire/webcom-server/downloads","issues_url":"https://api.github.com/repos/endfire/webcom-server/issues{/number}","pulls_url":"https://api.github.com/repos/endfire/webcom-server/pulls{/number}","milestones_url":"https://api.github.com/repos/endfire/webcom-server/milestones{/number}","notifications_url":"https://api.github.com/repos/endfire/webcom-server/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/endfire/webcom-server/labels{/name}","releases_url":"https://api.github.com/repos/endfire/webcom-server/releases{/id}","deployments_url":"https://api.github.com/repos/endfire/webcom-server/deployments","created_at":"2016-06-13T20:52:55Z","updated_at":"2016-06-14T02:11:32Z","pushed_at":"2016-06-28T16:36:53Z","git_url":"git://github.com/endfire/webcom-server.git","ssh_url":"git@github.com:endfire/webcom-server.git","clone_url":"https://github.com/endfire/webcom-server.git","svn_url":"https://github.com/endfire/webcom-server","homepage":"https://webcom-server.herokuapp.com","size":118,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":3,"forks":0,"open_issues":3,"watchers":0,"default_branch":"master"}},"base":{"label":"endfire:master","ref":"master","sha":"8772e281ed941f4b0623bd2444537cc3ab66d74f","user":{"login":"endfire","id":13508451,"avatar_url":"https://avatars.githubusercontent.com/u/13508451?v=3","gravatar_id":"","url":"https://api.github.com/users/endfire","html_url":"https://github.com/endfire","followers_url":"https://api.github.com/users/endfire/followers","following_url":"https://api.github.com/users/endfire/following{/other_user}","gists_url":"https://api.github.com/users/endfire/gists{/gist_id}","starred_url":"https://api.github.com/users/endfire/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/endfire/subscriptions","organizations_url":"https://api.github.com/users/endfire/orgs","repos_url":"https://api.github.com/users/endfire/repos","events_url":"https://api.github.com/users/endfire/events{/privacy}","received_events_url":"https://api.github.com/users/endfire/received_events","type":"Organization","site_admin":false},"repo":{"id":61068885,"name":"webcom-server","full_name":"endfire/webcom-server","owner":{"login":"endfire","id":13508451,"avatar_url":"https://avatars.githubusercontent.com/u/13508451?v=3","gravatar_id":"","url":"https://api.github.com/users/endfire","html_url":"https://github.com/endfire","followers_url":"https://api.github.com/users/endfire/followers","following_url":"https://api.github.com/users/endfire/following{/other_user}","gists_url":"https://api.github.com/users/endfire/gists{/gist_id}","starred_url":"https://api.github.com/users/endfire/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/endfire/subscriptions","organizations_url":"https://api.github.com/users/endfire/orgs","repos_url":"https://api.github.com/users/endfire/repos","events_url":"https://api.github.com/users/endfire/events{/privacy}","received_events_url":"https://api.github.com/users/endfire/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/endfire/webcom-server","description":"Webcom's backend.","fork":false,"url":"https://api.github.com/repos/endfire/webcom-server","forks_url":"https://api.github.com/repos/endfire/webcom-server/forks","keys_url":"https://api.github.com/repos/endfire/webcom-server/keys{/key_id}","collaborators_url":"https://api.github.com/repos/endfire/webcom-server/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/endfire/webcom-server/teams","hooks_url":"https://api.github.com/repos/endfire/webcom-server/hooks","issue_events_url":"https://api.github.com/repos/endfire/webcom-server/issues/events{/number}","events_url":"https://api.github.com/repos/endfire/webcom-server/events","assignees_url":"https://api.github.com/repos/endfire/webcom-server/assignees{/user}","branches_url":"https://api.github.com/repos/endfire/webcom-server/branches{/branch}","tags_url":"https://api.github.com/repos/endfire/webcom-server/tags","blobs_url":"https://api.github.com/repos/endfire/webcom-server/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/endfire/webcom-server/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/endfire/webcom-server/git/refs{/sha}","trees_url":"https://api.github.com/repos/endfire/webcom-server/git/trees{/sha}","statuses_url":"https://api.github.com/repos/endfire/webcom-server/statuses/{sha}","languages_url":"https://api.github.com/repos/endfire/webcom-server/languages","stargazers_url":"https://api.github.com/repos/endfire/webcom-server/stargazers","contributors_url":"https://api.github.com/repos/endfire/webcom-server/contributors","subscribers_url":"https://api.github.com/repos/endfire/webcom-server/subscribers","subscription_url":"https://api.github.com/repos/endfire/webcom-server/subscription","commits_url":"https://api.github.com/repos/endfire/webcom-server/commits{/sha}","git_commits_url":"https://api.github.com/repos/endfire/webcom-server/git/commits{/sha}","comments_url":"https://api.github.com/repos/endfire/webcom-server/comments{/number}","issue_comment_url":"https://api.github.com/repos/endfire/webcom-server/issues/comments{/number}","contents_url":"https://api.github.com/repos/endfire/webcom-server/contents/{+path}","compare_url":"https://api.github.com/repos/endfire/webcom-server/compare/{base}...{head}","merges_url":"https://api.github.com/repos/endfire/webcom-server/merges","archive_url":"https://api.github.com/repos/endfire/webcom-server/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/endfire/webcom-server/downloads","issues_url":"https://api.github.com/repos/endfire/webcom-server/issues{/number}","pulls_url":"https://api.github.com/repos/endfire/webcom-server/pulls{/number}","milestones_url":"https://api.github.com/repos/endfire/webcom-server/milestones{/number}","notifications_url":"https://api.github.com/repos/endfire/webcom-server/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/endfire/webcom-server/labels{/name}","releases_url":"https://api.github.com/repos/endfire/webcom-server/releases{/id}","deployments_url":"https://api.github.com/repos/endfire/webcom-server/deployments","created_at":"2016-06-13T20:52:55Z","updated_at":"2016-06-14T02:11:32Z","pushed_at":"2016-06-28T16:36:53Z","git_url":"git://github.com/endfire/webcom-server.git","ssh_url":"git@github.com:endfire/webcom-server.git","clone_url":"https://github.com/endfire/webcom-server.git","svn_url":"https://github.com/endfire/webcom-server","homepage":"https://webcom-server.herokuapp.com","size":118,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":3,"forks":0,"open_issues":3,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/endfire/webcom-server/pulls/28"},"html":{"href":"https://github.com/endfire/webcom-server/pull/28"},"issue":{"href":"https://api.github.com/repos/endfire/webcom-server/issues/28"},"comments":{"href":"https://api.github.com/repos/endfire/webcom-server/issues/28/comments"},"review_comments":{"href":"https://api.github.com/repos/endfire/webcom-server/pulls/28/comments"},"review_comment":{"href":"https://api.github.com/repos/endfire/webcom-server/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/endfire/webcom-server/pulls/28/commits"},"statuses":{"href":"https://api.github.com/repos/endfire/webcom-server/statuses/c88e3198d423c0bd8df97ea8a0baf03069bbda1d"}}}}
{"actor":{"display_login":"dylnslck"}}