{"action":"created","comment":{"url":"https://api.github.com/repos/siggame/ophelia/pulls/comments/89720978","pull_request_review_id":10257186,"id":89720978,"diff_hunk":"@@ -0,0 +1,150 @@\n+DROP TABLE IF EXISTS \"competition\" CASCADE;\n+DROP TABLE IF EXISTS \"game\" CASCADE;\n+DROP TABLE IF EXISTS \"invitation\" CASCADE;\n+DROP TABLE IF EXISTS \"registration\" CASCADE;\n+DROP TABLE IF EXISTS \"team\" CASCADE;\n+DROP TABLE IF EXISTS \"user\" CASCADE;\n+\n+CREATE TYPE shirt_size_enum AS ENUM (\n+    'S', 'M', 'L', 'XL', 'XXL'\n+);\n+\n+CREATE TYPE pizza_choice_enum AS ENUM (\n+    'Cheese', 'Pepperoni', 'Bacon'\n+);\n+\n+CREATE TYPE client_language_enum AS ENUM (\n+    'cpp', 'js', 'lua', 'py', 'cs', 'java'\n+);\n+\n+CREATE TYPE invitation_response_enum AS ENUM (\n+    'accepted', 'declined'\n+);\n+\n+CREATE TABLE competition\n+(\n+  id serial NOT NULL,\n+  name character varying(64) NOT NULL,\n+  cost integer,\n+  description character varying(64),\n+  image bytea,\n+  start_time timestamp without time zone,\n+  end_time timestamp without time zone,\n+  is_open boolean,\n+  is_running boolean,\n+  min_num_team_members integer,\n+  max_num_team_members integer, --\n+  CONSTRAINT competition_pk PRIMARY KEY (id),\n+  CONSTRAINT competition_name_is_unique UNIQUE (name)\n+);\n+\n+\n+CREATE TABLE team\n+(\n+  id serial NOT NULL,\n+  name character varying(64) NOT NULL,\n+  gitlab_id integer,\n+  language client_language_enum,\n+  is_paid boolean,\n+  time_paid timestamp without time zone,\n+  created timestamp without time zone,\n+  is_eligible_to_win boolean,\n+  is_embargoed boolean,\n+  embargo_reason character varying(64),\n+  competition integer,\n+  CONSTRAINT team_pk PRIMARY KEY (id),\n+  CONSTRAINT team_competition_fk FOREIGN KEY (competition)\n+      REFERENCES competition (id) MATCH SIMPLE\n+      ON UPDATE NO ACTION ON DELETE NO ACTION,\n+  CONSTRAINT gitlab_id_is_unique UNIQUE (gitlab_id),\n+  CONSTRAINT name_is_unique UNIQUE (name)\n+);\n+\n+CREATE TABLE game\n+(\n+  id serial NOT NULL,\n+  competition integer,\n+  created timestamp without time zone,\n+  start_time timestamp without time zone,\n+  end_time timestamp without time zone,\n+  status character varying(64),\n+  winner integer,\n+  loser integer,\n+  win_reason character varying(64),\n+  lose_reason character varying(64),\n+  tie_or_fail_reason character varying(64),\n+  is_tied boolean,\n+  extra_data json,\n+  CONSTRAINT game_pk PRIMARY KEY (id),\n+  CONSTRAINT game_competition_fk FOREIGN KEY (competition)\n+      REFERENCES competition (id) MATCH SIMPLE\n+      ON UPDATE NO ACTION ON DELETE NO ACTION,\n+  CONSTRAINT game_loser_fk FOREIGN KEY (loser)\n+      REFERENCES team (id) MATCH SIMPLE\n+      ON UPDATE NO ACTION ON DELETE NO ACTION,\n+  CONSTRAINT game_winner_fk FOREIGN KEY (winner)\n+      REFERENCES team (id) MATCH SIMPLE\n+      ON UPDATE NO ACTION ON DELETE NO ACTION\n+);\n+\n+\n+\n+CREATE TABLE \"user\"\n+(\n+  name character varying(32),\n+  username character varying(32) NOT NULL,\n+  email character varying(64),\n+  is_dev boolean,\n+  is_full_time_student boolean,\n+  is_sponsor boolean,","path":"db/init.sql","position":99,"original_position":99,"commit_id":"145a220a8fa1cffa4a7e2c54947b7d807110e43e","original_commit_id":"145a220a8fa1cffa4a7e2c54947b7d807110e43e","user":{"login":"russleyshaw","id":2314816,"avatar_url":"https://avatars.githubusercontent.com/u/2314816?v=3","gravatar_id":"","url":"https://api.github.com/users/russleyshaw","html_url":"https://github.com/russleyshaw","followers_url":"https://api.github.com/users/russleyshaw/followers","following_url":"https://api.github.com/users/russleyshaw/following{/other_user}","gists_url":"https://api.github.com/users/russleyshaw/gists{/gist_id}","starred_url":"https://api.github.com/users/russleyshaw/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/russleyshaw/subscriptions","organizations_url":"https://api.github.com/users/russleyshaw/orgs","repos_url":"https://api.github.com/users/russleyshaw/repos","events_url":"https://api.github.com/users/russleyshaw/events{/privacy}","received_events_url":"https://api.github.com/users/russleyshaw/received_events","type":"User","site_admin":false},"body":"default false and NOT NULL","created_at":"2016-11-28T05:50:10Z","updated_at":"2016-11-28T06:00:38Z","html_url":"https://github.com/siggame/ophelia/pull/17#discussion_r89720978","pull_request_url":"https://api.github.com/repos/siggame/ophelia/pulls/17","_links":{"self":{"href":"https://api.github.com/repos/siggame/ophelia/pulls/comments/89720978"},"html":{"href":"https://github.com/siggame/ophelia/pull/17#discussion_r89720978"},"pull_request":{"href":"https://api.github.com/repos/siggame/ophelia/pulls/17"}}},"pull_request":{"url":"https://api.github.com/repos/siggame/ophelia/pulls/17","id":95439624,"html_url":"https://github.com/siggame/ophelia/pull/17","diff_url":"https://github.com/siggame/ophelia/pull/17.diff","patch_url":"https://github.com/siggame/ophelia/pull/17.patch","issue_url":"https://api.github.com/repos/siggame/ophelia/issues/17","number":17,"state":"open","locked":false,"title":"Initial Database Configuration","user":{"login":"jonsimington","id":5304384,"avatar_url":"https://avatars.githubusercontent.com/u/5304384?v=3","gravatar_id":"","url":"https://api.github.com/users/jonsimington","html_url":"https://github.com/jonsimington","followers_url":"https://api.github.com/users/jonsimington/followers","following_url":"https://api.github.com/users/jonsimington/following{/other_user}","gists_url":"https://api.github.com/users/jonsimington/gists{/gist_id}","starred_url":"https://api.github.com/users/jonsimington/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jonsimington/subscriptions","organizations_url":"https://api.github.com/users/jonsimington/orgs","repos_url":"https://api.github.com/users/jonsimington/repos","events_url":"https://api.github.com/users/jonsimington/events{/privacy}","received_events_url":"https://api.github.com/users/jonsimington/received_events","type":"User","site_admin":false},"body":"Finally got around to finishing this.  Please take a look through the commits and leave your comments.  \r\n\r\nSome notes to help anyone test this, in case you care to do so:\r\n\r\n1.  clone jonsimington/ophelia\r\n2.  Switch branches `git checkout feature/initial-database`\r\n3.  Build the project `make fresh`\r\n4.  Run the server `make run`\r\n5.  Access `localhost:3000/examples/knex`.  Observe the output and reload once or twice.  It's a very simple example, but hopefully it shows how to build some simple queries with the knex library.\r\n\r\nIf you ever want to get a fresh database, just run `make recycle-containers` followed by `make run`. \r\n\r\nLet me know if you have any questions!","created_at":"2016-11-28T05:18:38Z","updated_at":"2016-11-28T06:00:38Z","closed_at":null,"merged_at":null,"merge_commit_sha":"2c54e51edf3bc3983d2c8b61268064b0b8441b86","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/siggame/ophelia/pulls/17/commits","review_comments_url":"https://api.github.com/repos/siggame/ophelia/pulls/17/comments","review_comment_url":"https://api.github.com/repos/siggame/ophelia/pulls/comments{/number}","comments_url":"https://api.github.com/repos/siggame/ophelia/issues/17/comments","statuses_url":"https://api.github.com/repos/siggame/ophelia/statuses/145a220a8fa1cffa4a7e2c54947b7d807110e43e","head":{"label":"jonsimington:feature/initial-database","ref":"feature/initial-database","sha":"145a220a8fa1cffa4a7e2c54947b7d807110e43e","user":{"login":"jonsimington","id":5304384,"avatar_url":"https://avatars.githubusercontent.com/u/5304384?v=3","gravatar_id":"","url":"https://api.github.com/users/jonsimington","html_url":"https://github.com/jonsimington","followers_url":"https://api.github.com/users/jonsimington/followers","following_url":"https://api.github.com/users/jonsimington/following{/other_user}","gists_url":"https://api.github.com/users/jonsimington/gists{/gist_id}","starred_url":"https://api.github.com/users/jonsimington/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jonsimington/subscriptions","organizations_url":"https://api.github.com/users/jonsimington/orgs","repos_url":"https://api.github.com/users/jonsimington/repos","events_url":"https://api.github.com/users/jonsimington/events{/privacy}","received_events_url":"https://api.github.com/users/jonsimington/received_events","type":"User","site_admin":false},"repo":{"id":73991287,"name":"ophelia","full_name":"jonsimington/ophelia","owner":{"login":"jonsimington","id":5304384,"avatar_url":"https://avatars.githubusercontent.com/u/5304384?v=3","gravatar_id":"","url":"https://api.github.com/users/jonsimington","html_url":"https://github.com/jonsimington","followers_url":"https://api.github.com/users/jonsimington/followers","following_url":"https://api.github.com/users/jonsimington/following{/other_user}","gists_url":"https://api.github.com/users/jonsimington/gists{/gist_id}","starred_url":"https://api.github.com/users/jonsimington/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jonsimington/subscriptions","organizations_url":"https://api.github.com/users/jonsimington/orgs","repos_url":"https://api.github.com/users/jonsimington/repos","events_url":"https://api.github.com/users/jonsimington/events{/privacy}","received_events_url":"https://api.github.com/users/jonsimington/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/jonsimington/ophelia","description":"The new Missouri S&T ACM SIG-Game webserver application.","fork":true,"url":"https://api.github.com/repos/jonsimington/ophelia","forks_url":"https://api.github.com/repos/jonsimington/ophelia/forks","keys_url":"https://api.github.com/repos/jonsimington/ophelia/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jonsimington/ophelia/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jonsimington/ophelia/teams","hooks_url":"https://api.github.com/repos/jonsimington/ophelia/hooks","issue_events_url":"https://api.github.com/repos/jonsimington/ophelia/issues/events{/number}","events_url":"https://api.github.com/repos/jonsimington/ophelia/events","assignees_url":"https://api.github.com/repos/jonsimington/ophelia/assignees{/user}","branches_url":"https://api.github.com/repos/jonsimington/ophelia/branches{/branch}","tags_url":"https://api.github.com/repos/jonsimington/ophelia/tags","blobs_url":"https://api.github.com/repos/jonsimington/ophelia/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jonsimington/ophelia/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jonsimington/ophelia/git/refs{/sha}","trees_url":"https://api.github.com/repos/jonsimington/ophelia/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jonsimington/ophelia/statuses/{sha}","languages_url":"https://api.github.com/repos/jonsimington/ophelia/languages","stargazers_url":"https://api.github.com/repos/jonsimington/ophelia/stargazers","contributors_url":"https://api.github.com/repos/jonsimington/ophelia/contributors","subscribers_url":"https://api.github.com/repos/jonsimington/ophelia/subscribers","subscription_url":"https://api.github.com/repos/jonsimington/ophelia/subscription","commits_url":"https://api.github.com/repos/jonsimington/ophelia/commits{/sha}","git_commits_url":"https://api.github.com/repos/jonsimington/ophelia/git/commits{/sha}","comments_url":"https://api.github.com/repos/jonsimington/ophelia/comments{/number}","issue_comment_url":"https://api.github.com/repos/jonsimington/ophelia/issues/comments{/number}","contents_url":"https://api.github.com/repos/jonsimington/ophelia/contents/{+path}","compare_url":"https://api.github.com/repos/jonsimington/ophelia/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jonsimington/ophelia/merges","archive_url":"https://api.github.com/repos/jonsimington/ophelia/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jonsimington/ophelia/downloads","issues_url":"https://api.github.com/repos/jonsimington/ophelia/issues{/number}","pulls_url":"https://api.github.com/repos/jonsimington/ophelia/pulls{/number}","milestones_url":"https://api.github.com/repos/jonsimington/ophelia/milestones{/number}","notifications_url":"https://api.github.com/repos/jonsimington/ophelia/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jonsimington/ophelia/labels{/name}","releases_url":"https://api.github.com/repos/jonsimington/ophelia/releases{/id}","deployments_url":"https://api.github.com/repos/jonsimington/ophelia/deployments","created_at":"2016-11-17T04:49:03Z","updated_at":"2016-11-17T04:49:04Z","pushed_at":"2016-11-28T05:20:31Z","git_url":"git://github.com/jonsimington/ophelia.git","ssh_url":"git@github.com:jonsimington/ophelia.git","clone_url":"https://github.com/jonsimington/ophelia.git","svn_url":"https://github.com/jonsimington/ophelia","homepage":null,"size":16,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","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":"siggame:master","ref":"master","sha":"7de0f85e9ca28c9836495ca3c84b7d9d0928deb4","user":{"login":"siggame","id":739658,"avatar_url":"https://avatars.githubusercontent.com/u/739658?v=3","gravatar_id":"","url":"https://api.github.com/users/siggame","html_url":"https://github.com/siggame","followers_url":"https://api.github.com/users/siggame/followers","following_url":"https://api.github.com/users/siggame/following{/other_user}","gists_url":"https://api.github.com/users/siggame/gists{/gist_id}","starred_url":"https://api.github.com/users/siggame/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/siggame/subscriptions","organizations_url":"https://api.github.com/users/siggame/orgs","repos_url":"https://api.github.com/users/siggame/repos","events_url":"https://api.github.com/users/siggame/events{/privacy}","received_events_url":"https://api.github.com/users/siggame/received_events","type":"Organization","site_admin":false},"repo":{"id":72885979,"name":"ophelia","full_name":"siggame/ophelia","owner":{"login":"siggame","id":739658,"avatar_url":"https://avatars.githubusercontent.com/u/739658?v=3","gravatar_id":"","url":"https://api.github.com/users/siggame","html_url":"https://github.com/siggame","followers_url":"https://api.github.com/users/siggame/followers","following_url":"https://api.github.com/users/siggame/following{/other_user}","gists_url":"https://api.github.com/users/siggame/gists{/gist_id}","starred_url":"https://api.github.com/users/siggame/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/siggame/subscriptions","organizations_url":"https://api.github.com/users/siggame/orgs","repos_url":"https://api.github.com/users/siggame/repos","events_url":"https://api.github.com/users/siggame/events{/privacy}","received_events_url":"https://api.github.com/users/siggame/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/siggame/ophelia","description":"The new Missouri S&T ACM SIG-Game webserver application.","fork":false,"url":"https://api.github.com/repos/siggame/ophelia","forks_url":"https://api.github.com/repos/siggame/ophelia/forks","keys_url":"https://api.github.com/repos/siggame/ophelia/keys{/key_id}","collaborators_url":"https://api.github.com/repos/siggame/ophelia/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/siggame/ophelia/teams","hooks_url":"https://api.github.com/repos/siggame/ophelia/hooks","issue_events_url":"https://api.github.com/repos/siggame/ophelia/issues/events{/number}","events_url":"https://api.github.com/repos/siggame/ophelia/events","assignees_url":"https://api.github.com/repos/siggame/ophelia/assignees{/user}","branches_url":"https://api.github.com/repos/siggame/ophelia/branches{/branch}","tags_url":"https://api.github.com/repos/siggame/ophelia/tags","blobs_url":"https://api.github.com/repos/siggame/ophelia/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/siggame/ophelia/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/siggame/ophelia/git/refs{/sha}","trees_url":"https://api.github.com/repos/siggame/ophelia/git/trees{/sha}","statuses_url":"https://api.github.com/repos/siggame/ophelia/statuses/{sha}","languages_url":"https://api.github.com/repos/siggame/ophelia/languages","stargazers_url":"https://api.github.com/repos/siggame/ophelia/stargazers","contributors_url":"https://api.github.com/repos/siggame/ophelia/contributors","subscribers_url":"https://api.github.com/repos/siggame/ophelia/subscribers","subscription_url":"https://api.github.com/repos/siggame/ophelia/subscription","commits_url":"https://api.github.com/repos/siggame/ophelia/commits{/sha}","git_commits_url":"https://api.github.com/repos/siggame/ophelia/git/commits{/sha}","comments_url":"https://api.github.com/repos/siggame/ophelia/comments{/number}","issue_comment_url":"https://api.github.com/repos/siggame/ophelia/issues/comments{/number}","contents_url":"https://api.github.com/repos/siggame/ophelia/contents/{+path}","compare_url":"https://api.github.com/repos/siggame/ophelia/compare/{base}...{head}","merges_url":"https://api.github.com/repos/siggame/ophelia/merges","archive_url":"https://api.github.com/repos/siggame/ophelia/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/siggame/ophelia/downloads","issues_url":"https://api.github.com/repos/siggame/ophelia/issues{/number}","pulls_url":"https://api.github.com/repos/siggame/ophelia/pulls{/number}","milestones_url":"https://api.github.com/repos/siggame/ophelia/milestones{/number}","notifications_url":"https://api.github.com/repos/siggame/ophelia/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/siggame/ophelia/labels{/name}","releases_url":"https://api.github.com/repos/siggame/ophelia/releases{/id}","deployments_url":"https://api.github.com/repos/siggame/ophelia/deployments","created_at":"2016-11-04T21:15:58Z","updated_at":"2016-11-07T18:56:08Z","pushed_at":"2016-11-28T05:20:32Z","git_url":"git://github.com/siggame/ophelia.git","ssh_url":"git@github.com:siggame/ophelia.git","clone_url":"https://github.com/siggame/ophelia.git","svn_url":"https://github.com/siggame/ophelia","homepage":null,"size":9,"stargazers_count":1,"watchers_count":1,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":5,"mirror_url":null,"open_issues_count":16,"forks":5,"open_issues":16,"watchers":1,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/siggame/ophelia/pulls/17"},"html":{"href":"https://github.com/siggame/ophelia/pull/17"},"issue":{"href":"https://api.github.com/repos/siggame/ophelia/issues/17"},"comments":{"href":"https://api.github.com/repos/siggame/ophelia/issues/17/comments"},"review_comments":{"href":"https://api.github.com/repos/siggame/ophelia/pulls/17/comments"},"review_comment":{"href":"https://api.github.com/repos/siggame/ophelia/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/siggame/ophelia/pulls/17/commits"},"statuses":{"href":"https://api.github.com/repos/siggame/ophelia/statuses/145a220a8fa1cffa4a7e2c54947b7d807110e43e"}}}}
{"actor":{"display_login":"russleyshaw"}}