{"action":"created","comment":{"url":"https://api.github.com/repos/fxbox/users/pulls/comments/56341657","id":56341657,"diff_hunk":"@@ -264,7 +285,14 @@ impl UsersDb {\n                 email       TEXT NOT NULL UNIQUE,\n                 password    TEXT NOT NULL,\n                 secret      TEXT NOT NULL,\n-                is_admin    BOOL NOT NULL DEFAULT 0\n+                is_admin    BOOL NOT NULL DEFAULT 0,\n+                push_uri    TEXT,\n+                push_key    TEXT","path":"src/users_db.rs","position":89,"original_position":89,"commit_id":"17c34b75f18b0381bd11a0872d1b2795a7b92230","original_commit_id":"17c34b75f18b0381bd11a0872d1b2795a7b92230","user":{"login":"ferjm","id":480202,"avatar_url":"https://avatars.githubusercontent.com/u/480202?v=3","gravatar_id":"","url":"https://api.github.com/users/ferjm","html_url":"https://github.com/ferjm","followers_url":"https://api.github.com/users/ferjm/followers","following_url":"https://api.github.com/users/ferjm/following{/other_user}","gists_url":"https://api.github.com/users/ferjm/gists{/gist_id}","starred_url":"https://api.github.com/users/ferjm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ferjm/subscriptions","organizations_url":"https://api.github.com/users/ferjm/orgs","repos_url":"https://api.github.com/users/ferjm/repos","events_url":"https://api.github.com/users/ferjm/events{/privacy}","received_events_url":"https://api.github.com/users/ferjm/received_events","type":"User","site_admin":false},"body":"I am afraid that this schema does not scale properly.\r\n\r\nThink about the case where we have a user signed in in multiple clients (desktop browser and mobile browser). Each client will get an independent push endpoint, but we can only store one per user.\r\n\r\nWe need separate table or even better a separate db where we can store multiple push endpoints and keys associated to a single user. And this can probably be done outside of this crate.","created_at":"2016-03-16T14:25:02Z","updated_at":"2016-03-16T14:25:02Z","html_url":"https://github.com/fxbox/users/pull/73#discussion_r56341657","pull_request_url":"https://api.github.com/repos/fxbox/users/pulls/73","_links":{"self":{"href":"https://api.github.com/repos/fxbox/users/pulls/comments/56341657"},"html":{"href":"https://github.com/fxbox/users/pull/73#discussion_r56341657"},"pull_request":{"href":"https://api.github.com/repos/fxbox/users/pulls/73"}}},"pull_request":{"url":"https://api.github.com/repos/fxbox/users/pulls/73","id":63001658,"html_url":"https://github.com/fxbox/users/pull/73","diff_url":"https://github.com/fxbox/users/pull/73.diff","patch_url":"https://github.com/fxbox/users/pull/73.patch","issue_url":"https://api.github.com/repos/fxbox/users/issues/73","number":73,"state":"open","locked":false,"title":"Add WebPush support","user":{"login":"aosmond","id":1681373,"avatar_url":"https://avatars.githubusercontent.com/u/1681373?v=3","gravatar_id":"","url":"https://api.github.com/users/aosmond","html_url":"https://github.com/aosmond","followers_url":"https://api.github.com/users/aosmond/followers","following_url":"https://api.github.com/users/aosmond/following{/other_user}","gists_url":"https://api.github.com/users/aosmond/gists{/gist_id}","starred_url":"https://api.github.com/users/aosmond/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aosmond/subscriptions","organizations_url":"https://api.github.com/users/aosmond/orgs","repos_url":"https://api.github.com/users/aosmond/repos","events_url":"https://api.github.com/users/aosmond/events{/privacy}","received_events_url":"https://api.github.com/users/aosmond/received_events","type":"User","site_admin":false},"body":"","created_at":"2016-03-16T01:16:29Z","updated_at":"2016-03-16T14:25:02Z","closed_at":null,"merged_at":null,"merge_commit_sha":"02291c7fd57619402a33f840928db7a11ecea626","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/fxbox/users/pulls/73/commits","review_comments_url":"https://api.github.com/repos/fxbox/users/pulls/73/comments","review_comment_url":"https://api.github.com/repos/fxbox/users/pulls/comments{/number}","comments_url":"https://api.github.com/repos/fxbox/users/issues/73/comments","statuses_url":"https://api.github.com/repos/fxbox/users/statuses/17c34b75f18b0381bd11a0872d1b2795a7b92230","head":{"label":"aosmond:webpush","ref":"webpush","sha":"17c34b75f18b0381bd11a0872d1b2795a7b92230","user":{"login":"aosmond","id":1681373,"avatar_url":"https://avatars.githubusercontent.com/u/1681373?v=3","gravatar_id":"","url":"https://api.github.com/users/aosmond","html_url":"https://github.com/aosmond","followers_url":"https://api.github.com/users/aosmond/followers","following_url":"https://api.github.com/users/aosmond/following{/other_user}","gists_url":"https://api.github.com/users/aosmond/gists{/gist_id}","starred_url":"https://api.github.com/users/aosmond/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aosmond/subscriptions","organizations_url":"https://api.github.com/users/aosmond/orgs","repos_url":"https://api.github.com/users/aosmond/repos","events_url":"https://api.github.com/users/aosmond/events{/privacy}","received_events_url":"https://api.github.com/users/aosmond/received_events","type":"User","site_admin":false},"repo":{"id":53978651,"name":"users","full_name":"aosmond/users","owner":{"login":"aosmond","id":1681373,"avatar_url":"https://avatars.githubusercontent.com/u/1681373?v=3","gravatar_id":"","url":"https://api.github.com/users/aosmond","html_url":"https://github.com/aosmond","followers_url":"https://api.github.com/users/aosmond/followers","following_url":"https://api.github.com/users/aosmond/following{/other_user}","gists_url":"https://api.github.com/users/aosmond/gists{/gist_id}","starred_url":"https://api.github.com/users/aosmond/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aosmond/subscriptions","organizations_url":"https://api.github.com/users/aosmond/orgs","repos_url":"https://api.github.com/users/aosmond/repos","events_url":"https://api.github.com/users/aosmond/events{/privacy}","received_events_url":"https://api.github.com/users/aosmond/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/aosmond/users","description":"Project Link user management and authentication lib","fork":true,"url":"https://api.github.com/repos/aosmond/users","forks_url":"https://api.github.com/repos/aosmond/users/forks","keys_url":"https://api.github.com/repos/aosmond/users/keys{/key_id}","collaborators_url":"https://api.github.com/repos/aosmond/users/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/aosmond/users/teams","hooks_url":"https://api.github.com/repos/aosmond/users/hooks","issue_events_url":"https://api.github.com/repos/aosmond/users/issues/events{/number}","events_url":"https://api.github.com/repos/aosmond/users/events","assignees_url":"https://api.github.com/repos/aosmond/users/assignees{/user}","branches_url":"https://api.github.com/repos/aosmond/users/branches{/branch}","tags_url":"https://api.github.com/repos/aosmond/users/tags","blobs_url":"https://api.github.com/repos/aosmond/users/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/aosmond/users/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/aosmond/users/git/refs{/sha}","trees_url":"https://api.github.com/repos/aosmond/users/git/trees{/sha}","statuses_url":"https://api.github.com/repos/aosmond/users/statuses/{sha}","languages_url":"https://api.github.com/repos/aosmond/users/languages","stargazers_url":"https://api.github.com/repos/aosmond/users/stargazers","contributors_url":"https://api.github.com/repos/aosmond/users/contributors","subscribers_url":"https://api.github.com/repos/aosmond/users/subscribers","subscription_url":"https://api.github.com/repos/aosmond/users/subscription","commits_url":"https://api.github.com/repos/aosmond/users/commits{/sha}","git_commits_url":"https://api.github.com/repos/aosmond/users/git/commits{/sha}","comments_url":"https://api.github.com/repos/aosmond/users/comments{/number}","issue_comment_url":"https://api.github.com/repos/aosmond/users/issues/comments{/number}","contents_url":"https://api.github.com/repos/aosmond/users/contents/{+path}","compare_url":"https://api.github.com/repos/aosmond/users/compare/{base}...{head}","merges_url":"https://api.github.com/repos/aosmond/users/merges","archive_url":"https://api.github.com/repos/aosmond/users/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/aosmond/users/downloads","issues_url":"https://api.github.com/repos/aosmond/users/issues{/number}","pulls_url":"https://api.github.com/repos/aosmond/users/pulls{/number}","milestones_url":"https://api.github.com/repos/aosmond/users/milestones{/number}","notifications_url":"https://api.github.com/repos/aosmond/users/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/aosmond/users/labels{/name}","releases_url":"https://api.github.com/repos/aosmond/users/releases{/id}","deployments_url":"https://api.github.com/repos/aosmond/users/deployments","created_at":"2016-03-15T21:08:56Z","updated_at":"2016-03-15T21:08:57Z","pushed_at":"2016-03-16T00:54:18Z","git_url":"git://github.com/aosmond/users.git","ssh_url":"git@github.com:aosmond/users.git","clone_url":"https://github.com/aosmond/users.git","svn_url":"https://github.com/aosmond/users","homepage":"https://wiki.mozilla.org/Project_Link","size":108,"stargazers_count":0,"watchers_count":0,"language":"Rust","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"fxbox:master","ref":"master","sha":"3db32f0057bc70c78e8132b5d03b9a0a3dedbad7","user":{"login":"fxbox","id":17052474,"avatar_url":"https://avatars.githubusercontent.com/u/17052474?v=3","gravatar_id":"","url":"https://api.github.com/users/fxbox","html_url":"https://github.com/fxbox","followers_url":"https://api.github.com/users/fxbox/followers","following_url":"https://api.github.com/users/fxbox/following{/other_user}","gists_url":"https://api.github.com/users/fxbox/gists{/gist_id}","starred_url":"https://api.github.com/users/fxbox/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fxbox/subscriptions","organizations_url":"https://api.github.com/users/fxbox/orgs","repos_url":"https://api.github.com/users/fxbox/repos","events_url":"https://api.github.com/users/fxbox/events{/privacy}","received_events_url":"https://api.github.com/users/fxbox/received_events","type":"Organization","site_admin":false},"repo":{"id":51298614,"name":"users","full_name":"fxbox/users","owner":{"login":"fxbox","id":17052474,"avatar_url":"https://avatars.githubusercontent.com/u/17052474?v=3","gravatar_id":"","url":"https://api.github.com/users/fxbox","html_url":"https://github.com/fxbox","followers_url":"https://api.github.com/users/fxbox/followers","following_url":"https://api.github.com/users/fxbox/following{/other_user}","gists_url":"https://api.github.com/users/fxbox/gists{/gist_id}","starred_url":"https://api.github.com/users/fxbox/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fxbox/subscriptions","organizations_url":"https://api.github.com/users/fxbox/orgs","repos_url":"https://api.github.com/users/fxbox/repos","events_url":"https://api.github.com/users/fxbox/events{/privacy}","received_events_url":"https://api.github.com/users/fxbox/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/fxbox/users","description":"Project Link user management and authentication lib","fork":false,"url":"https://api.github.com/repos/fxbox/users","forks_url":"https://api.github.com/repos/fxbox/users/forks","keys_url":"https://api.github.com/repos/fxbox/users/keys{/key_id}","collaborators_url":"https://api.github.com/repos/fxbox/users/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/fxbox/users/teams","hooks_url":"https://api.github.com/repos/fxbox/users/hooks","issue_events_url":"https://api.github.com/repos/fxbox/users/issues/events{/number}","events_url":"https://api.github.com/repos/fxbox/users/events","assignees_url":"https://api.github.com/repos/fxbox/users/assignees{/user}","branches_url":"https://api.github.com/repos/fxbox/users/branches{/branch}","tags_url":"https://api.github.com/repos/fxbox/users/tags","blobs_url":"https://api.github.com/repos/fxbox/users/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/fxbox/users/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/fxbox/users/git/refs{/sha}","trees_url":"https://api.github.com/repos/fxbox/users/git/trees{/sha}","statuses_url":"https://api.github.com/repos/fxbox/users/statuses/{sha}","languages_url":"https://api.github.com/repos/fxbox/users/languages","stargazers_url":"https://api.github.com/repos/fxbox/users/stargazers","contributors_url":"https://api.github.com/repos/fxbox/users/contributors","subscribers_url":"https://api.github.com/repos/fxbox/users/subscribers","subscription_url":"https://api.github.com/repos/fxbox/users/subscription","commits_url":"https://api.github.com/repos/fxbox/users/commits{/sha}","git_commits_url":"https://api.github.com/repos/fxbox/users/git/commits{/sha}","comments_url":"https://api.github.com/repos/fxbox/users/comments{/number}","issue_comment_url":"https://api.github.com/repos/fxbox/users/issues/comments{/number}","contents_url":"https://api.github.com/repos/fxbox/users/contents/{+path}","compare_url":"https://api.github.com/repos/fxbox/users/compare/{base}...{head}","merges_url":"https://api.github.com/repos/fxbox/users/merges","archive_url":"https://api.github.com/repos/fxbox/users/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/fxbox/users/downloads","issues_url":"https://api.github.com/repos/fxbox/users/issues{/number}","pulls_url":"https://api.github.com/repos/fxbox/users/pulls{/number}","milestones_url":"https://api.github.com/repos/fxbox/users/milestones{/number}","notifications_url":"https://api.github.com/repos/fxbox/users/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/fxbox/users/labels{/name}","releases_url":"https://api.github.com/repos/fxbox/users/releases{/id}","deployments_url":"https://api.github.com/repos/fxbox/users/deployments","created_at":"2016-02-08T13:11:49Z","updated_at":"2016-03-03T09:48:54Z","pushed_at":"2016-03-16T09:48:07Z","git_url":"git://github.com/fxbox/users.git","ssh_url":"git@github.com:fxbox/users.git","clone_url":"https://github.com/fxbox/users.git","svn_url":"https://github.com/fxbox/users","homepage":"https://wiki.mozilla.org/Project_Link","size":113,"stargazers_count":0,"watchers_count":0,"language":"Rust","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":6,"mirror_url":null,"open_issues_count":6,"forks":6,"open_issues":6,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/fxbox/users/pulls/73"},"html":{"href":"https://github.com/fxbox/users/pull/73"},"issue":{"href":"https://api.github.com/repos/fxbox/users/issues/73"},"comments":{"href":"https://api.github.com/repos/fxbox/users/issues/73/comments"},"review_comments":{"href":"https://api.github.com/repos/fxbox/users/pulls/73/comments"},"review_comment":{"href":"https://api.github.com/repos/fxbox/users/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/fxbox/users/pulls/73/commits"},"statuses":{"href":"https://api.github.com/repos/fxbox/users/statuses/17c34b75f18b0381bd11a0872d1b2795a7b92230"}}}}