{"action":"created","comment":{"url":"https://api.github.com/repos/operable/cog/pulls/comments/93460115","pull_request_review_id":13988176,"id":93460115,"diff_hunk":"@@ -0,0 +1,13 @@\n+defmodule Cog.Repo.Migrations.TriggerUserReferentialIntegrity do\n+  use Ecto.Migration\n+\n+  def change do\n+    execute \"\"\"\n+    ALTER TABLE triggers\n+    ADD CONSTRAINT triggers_as_user_fkey\n+    FOREIGN KEY(as_user) REFERENCES users(username)\n+    ON DELETE RESTRICT\n+    ON UPDATE CASCADE","path":"priv/repo/migrations/20161220162331_trigger_user_referential_integrity.exs","position":10,"original_position":10,"commit_id":"753672d9c79a6ce48fdd17923851a9e6aa33c926","original_commit_id":"753672d9c79a6ce48fdd17923851a9e6aa33c926","user":{"login":"vanstee","id":228734,"avatar_url":"https://avatars.githubusercontent.com/u/228734?v=3","gravatar_id":"","url":"https://api.github.com/users/vanstee","html_url":"https://github.com/vanstee","followers_url":"https://api.github.com/users/vanstee/followers","following_url":"https://api.github.com/users/vanstee/following{/other_user}","gists_url":"https://api.github.com/users/vanstee/gists{/gist_id}","starred_url":"https://api.github.com/users/vanstee/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vanstee/subscriptions","organizations_url":"https://api.github.com/users/vanstee/orgs","repos_url":"https://api.github.com/users/vanstee/repos","events_url":"https://api.github.com/users/vanstee/events{/privacy}","received_events_url":"https://api.github.com/users/vanstee/received_events","type":"User","site_admin":false},"body":"This looks good, but wouldn't it be nicer to store the user id here instead? Then we wouldn't have to worry about updates.","created_at":"2016-12-21T15:35:41Z","updated_at":"2016-12-21T15:35:41Z","html_url":"https://github.com/operable/cog/pull/1274#discussion_r93460115","pull_request_url":"https://api.github.com/repos/operable/cog/pulls/1274","_links":{"self":{"href":"https://api.github.com/repos/operable/cog/pulls/comments/93460115"},"html":{"href":"https://github.com/operable/cog/pull/1274#discussion_r93460115"},"pull_request":{"href":"https://api.github.com/repos/operable/cog/pulls/1274"}}},"pull_request":{"url":"https://api.github.com/repos/operable/cog/pulls/1274","id":98810108,"html_url":"https://github.com/operable/cog/pull/1274","diff_url":"https://github.com/operable/cog/pull/1274.diff","patch_url":"https://github.com/operable/cog/pull/1274.patch","issue_url":"https://api.github.com/repos/operable/cog/issues/1274","number":1274,"state":"open","locked":false,"title":"Link triggers and their users via FK constraint","user":{"login":"christophermaier","id":207178,"avatar_url":"https://avatars.githubusercontent.com/u/207178?v=3","gravatar_id":"","url":"https://api.github.com/users/christophermaier","html_url":"https://github.com/christophermaier","followers_url":"https://api.github.com/users/christophermaier/followers","following_url":"https://api.github.com/users/christophermaier/following{/other_user}","gists_url":"https://api.github.com/users/christophermaier/gists{/gist_id}","starred_url":"https://api.github.com/users/christophermaier/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/christophermaier/subscriptions","organizations_url":"https://api.github.com/users/christophermaier/orgs","repos_url":"https://api.github.com/users/christophermaier/repos","events_url":"https://api.github.com/users/christophermaier/events{/privacy}","received_events_url":"https://api.github.com/users/christophermaier/received_events","type":"User","site_admin":false},"body":"If you attempt to delete a user that is currently associated with any\r\ntriggers (i.e., that user is the one the triggers run as), the request\r\nwill be blocked.\r\n\r\nThis will prevent triggers from breaking when users are deleted,\r\nallowing operators to re-wire their triggers as appropriate.\r\n\r\nFixes #1246","created_at":"2016-12-20T19:26:35Z","updated_at":"2016-12-21T15:35:41Z","closed_at":null,"merged_at":null,"merge_commit_sha":"af88b02e89c8e19f2e8ccb4a2ede919b4264485f","assignee":{"login":"christophermaier","id":207178,"avatar_url":"https://avatars.githubusercontent.com/u/207178?v=3","gravatar_id":"","url":"https://api.github.com/users/christophermaier","html_url":"https://github.com/christophermaier","followers_url":"https://api.github.com/users/christophermaier/followers","following_url":"https://api.github.com/users/christophermaier/following{/other_user}","gists_url":"https://api.github.com/users/christophermaier/gists{/gist_id}","starred_url":"https://api.github.com/users/christophermaier/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/christophermaier/subscriptions","organizations_url":"https://api.github.com/users/christophermaier/orgs","repos_url":"https://api.github.com/users/christophermaier/repos","events_url":"https://api.github.com/users/christophermaier/events{/privacy}","received_events_url":"https://api.github.com/users/christophermaier/received_events","type":"User","site_admin":false},"assignees":[{"login":"christophermaier","id":207178,"avatar_url":"https://avatars.githubusercontent.com/u/207178?v=3","gravatar_id":"","url":"https://api.github.com/users/christophermaier","html_url":"https://github.com/christophermaier","followers_url":"https://api.github.com/users/christophermaier/followers","following_url":"https://api.github.com/users/christophermaier/following{/other_user}","gists_url":"https://api.github.com/users/christophermaier/gists{/gist_id}","starred_url":"https://api.github.com/users/christophermaier/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/christophermaier/subscriptions","organizations_url":"https://api.github.com/users/christophermaier/orgs","repos_url":"https://api.github.com/users/christophermaier/repos","events_url":"https://api.github.com/users/christophermaier/events{/privacy}","received_events_url":"https://api.github.com/users/christophermaier/received_events","type":"User","site_admin":false}],"milestone":null,"commits_url":"https://api.github.com/repos/operable/cog/pulls/1274/commits","review_comments_url":"https://api.github.com/repos/operable/cog/pulls/1274/comments","review_comment_url":"https://api.github.com/repos/operable/cog/pulls/comments{/number}","comments_url":"https://api.github.com/repos/operable/cog/issues/1274/comments","statuses_url":"https://api.github.com/repos/operable/cog/statuses/753672d9c79a6ce48fdd17923851a9e6aa33c926","head":{"label":"operable:cm/trigger-referential-integrity","ref":"cm/trigger-referential-integrity","sha":"753672d9c79a6ce48fdd17923851a9e6aa33c926","user":{"login":"operable","id":6070463,"avatar_url":"https://avatars.githubusercontent.com/u/6070463?v=3","gravatar_id":"","url":"https://api.github.com/users/operable","html_url":"https://github.com/operable","followers_url":"https://api.github.com/users/operable/followers","following_url":"https://api.github.com/users/operable/following{/other_user}","gists_url":"https://api.github.com/users/operable/gists{/gist_id}","starred_url":"https://api.github.com/users/operable/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/operable/subscriptions","organizations_url":"https://api.github.com/users/operable/orgs","repos_url":"https://api.github.com/users/operable/repos","events_url":"https://api.github.com/users/operable/events{/privacy}","received_events_url":"https://api.github.com/users/operable/received_events","type":"Organization","site_admin":false},"repo":{"id":49292670,"name":"cog","full_name":"operable/cog","owner":{"login":"operable","id":6070463,"avatar_url":"https://avatars.githubusercontent.com/u/6070463?v=3","gravatar_id":"","url":"https://api.github.com/users/operable","html_url":"https://github.com/operable","followers_url":"https://api.github.com/users/operable/followers","following_url":"https://api.github.com/users/operable/following{/other_user}","gists_url":"https://api.github.com/users/operable/gists{/gist_id}","starred_url":"https://api.github.com/users/operable/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/operable/subscriptions","organizations_url":"https://api.github.com/users/operable/orgs","repos_url":"https://api.github.com/users/operable/repos","events_url":"https://api.github.com/users/operable/events{/privacy}","received_events_url":"https://api.github.com/users/operable/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/operable/cog","description":"Bringing the power of the command line to chat","fork":false,"url":"https://api.github.com/repos/operable/cog","forks_url":"https://api.github.com/repos/operable/cog/forks","keys_url":"https://api.github.com/repos/operable/cog/keys{/key_id}","collaborators_url":"https://api.github.com/repos/operable/cog/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/operable/cog/teams","hooks_url":"https://api.github.com/repos/operable/cog/hooks","issue_events_url":"https://api.github.com/repos/operable/cog/issues/events{/number}","events_url":"https://api.github.com/repos/operable/cog/events","assignees_url":"https://api.github.com/repos/operable/cog/assignees{/user}","branches_url":"https://api.github.com/repos/operable/cog/branches{/branch}","tags_url":"https://api.github.com/repos/operable/cog/tags","blobs_url":"https://api.github.com/repos/operable/cog/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/operable/cog/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/operable/cog/git/refs{/sha}","trees_url":"https://api.github.com/repos/operable/cog/git/trees{/sha}","statuses_url":"https://api.github.com/repos/operable/cog/statuses/{sha}","languages_url":"https://api.github.com/repos/operable/cog/languages","stargazers_url":"https://api.github.com/repos/operable/cog/stargazers","contributors_url":"https://api.github.com/repos/operable/cog/contributors","subscribers_url":"https://api.github.com/repos/operable/cog/subscribers","subscription_url":"https://api.github.com/repos/operable/cog/subscription","commits_url":"https://api.github.com/repos/operable/cog/commits{/sha}","git_commits_url":"https://api.github.com/repos/operable/cog/git/commits{/sha}","comments_url":"https://api.github.com/repos/operable/cog/comments{/number}","issue_comment_url":"https://api.github.com/repos/operable/cog/issues/comments{/number}","contents_url":"https://api.github.com/repos/operable/cog/contents/{+path}","compare_url":"https://api.github.com/repos/operable/cog/compare/{base}...{head}","merges_url":"https://api.github.com/repos/operable/cog/merges","archive_url":"https://api.github.com/repos/operable/cog/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/operable/cog/downloads","issues_url":"https://api.github.com/repos/operable/cog/issues{/number}","pulls_url":"https://api.github.com/repos/operable/cog/pulls{/number}","milestones_url":"https://api.github.com/repos/operable/cog/milestones{/number}","notifications_url":"https://api.github.com/repos/operable/cog/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/operable/cog/labels{/name}","releases_url":"https://api.github.com/repos/operable/cog/releases{/id}","deployments_url":"https://api.github.com/repos/operable/cog/deployments","created_at":"2016-01-08T19:45:06Z","updated_at":"2016-12-20T18:53:22Z","pushed_at":"2016-12-21T15:25:22Z","git_url":"git://github.com/operable/cog.git","ssh_url":"git@github.com:operable/cog.git","clone_url":"https://github.com/operable/cog.git","svn_url":"https://github.com/operable/cog","homepage":"http://operable.io","size":4378,"stargazers_count":566,"watchers_count":566,"language":"Elixir","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":39,"mirror_url":null,"open_issues_count":103,"forks":39,"open_issues":103,"watchers":566,"default_branch":"master"}},"base":{"label":"operable:master","ref":"master","sha":"010479237c8d3edbbcffcbd442cadc64792e8a05","user":{"login":"operable","id":6070463,"avatar_url":"https://avatars.githubusercontent.com/u/6070463?v=3","gravatar_id":"","url":"https://api.github.com/users/operable","html_url":"https://github.com/operable","followers_url":"https://api.github.com/users/operable/followers","following_url":"https://api.github.com/users/operable/following{/other_user}","gists_url":"https://api.github.com/users/operable/gists{/gist_id}","starred_url":"https://api.github.com/users/operable/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/operable/subscriptions","organizations_url":"https://api.github.com/users/operable/orgs","repos_url":"https://api.github.com/users/operable/repos","events_url":"https://api.github.com/users/operable/events{/privacy}","received_events_url":"https://api.github.com/users/operable/received_events","type":"Organization","site_admin":false},"repo":{"id":49292670,"name":"cog","full_name":"operable/cog","owner":{"login":"operable","id":6070463,"avatar_url":"https://avatars.githubusercontent.com/u/6070463?v=3","gravatar_id":"","url":"https://api.github.com/users/operable","html_url":"https://github.com/operable","followers_url":"https://api.github.com/users/operable/followers","following_url":"https://api.github.com/users/operable/following{/other_user}","gists_url":"https://api.github.com/users/operable/gists{/gist_id}","starred_url":"https://api.github.com/users/operable/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/operable/subscriptions","organizations_url":"https://api.github.com/users/operable/orgs","repos_url":"https://api.github.com/users/operable/repos","events_url":"https://api.github.com/users/operable/events{/privacy}","received_events_url":"https://api.github.com/users/operable/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/operable/cog","description":"Bringing the power of the command line to chat","fork":false,"url":"https://api.github.com/repos/operable/cog","forks_url":"https://api.github.com/repos/operable/cog/forks","keys_url":"https://api.github.com/repos/operable/cog/keys{/key_id}","collaborators_url":"https://api.github.com/repos/operable/cog/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/operable/cog/teams","hooks_url":"https://api.github.com/repos/operable/cog/hooks","issue_events_url":"https://api.github.com/repos/operable/cog/issues/events{/number}","events_url":"https://api.github.com/repos/operable/cog/events","assignees_url":"https://api.github.com/repos/operable/cog/assignees{/user}","branches_url":"https://api.github.com/repos/operable/cog/branches{/branch}","tags_url":"https://api.github.com/repos/operable/cog/tags","blobs_url":"https://api.github.com/repos/operable/cog/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/operable/cog/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/operable/cog/git/refs{/sha}","trees_url":"https://api.github.com/repos/operable/cog/git/trees{/sha}","statuses_url":"https://api.github.com/repos/operable/cog/statuses/{sha}","languages_url":"https://api.github.com/repos/operable/cog/languages","stargazers_url":"https://api.github.com/repos/operable/cog/stargazers","contributors_url":"https://api.github.com/repos/operable/cog/contributors","subscribers_url":"https://api.github.com/repos/operable/cog/subscribers","subscription_url":"https://api.github.com/repos/operable/cog/subscription","commits_url":"https://api.github.com/repos/operable/cog/commits{/sha}","git_commits_url":"https://api.github.com/repos/operable/cog/git/commits{/sha}","comments_url":"https://api.github.com/repos/operable/cog/comments{/number}","issue_comment_url":"https://api.github.com/repos/operable/cog/issues/comments{/number}","contents_url":"https://api.github.com/repos/operable/cog/contents/{+path}","compare_url":"https://api.github.com/repos/operable/cog/compare/{base}...{head}","merges_url":"https://api.github.com/repos/operable/cog/merges","archive_url":"https://api.github.com/repos/operable/cog/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/operable/cog/downloads","issues_url":"https://api.github.com/repos/operable/cog/issues{/number}","pulls_url":"https://api.github.com/repos/operable/cog/pulls{/number}","milestones_url":"https://api.github.com/repos/operable/cog/milestones{/number}","notifications_url":"https://api.github.com/repos/operable/cog/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/operable/cog/labels{/name}","releases_url":"https://api.github.com/repos/operable/cog/releases{/id}","deployments_url":"https://api.github.com/repos/operable/cog/deployments","created_at":"2016-01-08T19:45:06Z","updated_at":"2016-12-20T18:53:22Z","pushed_at":"2016-12-21T15:25:22Z","git_url":"git://github.com/operable/cog.git","ssh_url":"git@github.com:operable/cog.git","clone_url":"https://github.com/operable/cog.git","svn_url":"https://github.com/operable/cog","homepage":"http://operable.io","size":4378,"stargazers_count":566,"watchers_count":566,"language":"Elixir","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":39,"mirror_url":null,"open_issues_count":103,"forks":39,"open_issues":103,"watchers":566,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/operable/cog/pulls/1274"},"html":{"href":"https://github.com/operable/cog/pull/1274"},"issue":{"href":"https://api.github.com/repos/operable/cog/issues/1274"},"comments":{"href":"https://api.github.com/repos/operable/cog/issues/1274/comments"},"review_comments":{"href":"https://api.github.com/repos/operable/cog/pulls/1274/comments"},"review_comment":{"href":"https://api.github.com/repos/operable/cog/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/operable/cog/pulls/1274/commits"},"statuses":{"href":"https://api.github.com/repos/operable/cog/statuses/753672d9c79a6ce48fdd17923851a9e6aa33c926"}}}}
{"actor":{"display_login":"vanstee"}}