{"action":"created","comment":{"url":"https://api.github.com/repos/htmlacademy-php/643755-yeticave-11/pulls/comments/341822808","pull_request_review_id":310784659,"id":341822808,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDM0MTgyMjgwOA==","diff_hunk":"@@ -0,0 +1,65 @@\n+CREATE DATABASE yeticave DEFAULT CHARACTER SET utf8 DEFAULT COLLATE utf8_general_ci;\n+\n+USE yeticave;\n+\n+CREATE TABLE categories (\n+  id INT UNSIGNED AUTO_INCREMENT PRIMARY KEY,\n+  name VARCHAR(255) NOT NULL,\n+  char_code VARCHAR(255) NOT NULL UNIQUE\n+);\n+\n+CREATE UNIQUE INDEX name_categories ON categories(name);\n+CREATE UNIQUE INDEX char_code_categories ON categories(char_code);\n+\n+CREATE TABLE users (\n+  id INT UNSIGNED AUTO_INCREMENT PRIMARY KEY,\n+  dt_add DATETIME DEFAULT CURRENT_TIMESTAMP,\n+  email VARCHAR(255) NOT NULL UNIQUE,\n+  name VARCHAR(255) NOT NULL,\n+  password VARCHAR(255) NOT NULL,\n+  contacts TEXT NOT NULL\n+);\n+\n+CREATE UNIQUE INDEX email_users ON users(email);\n+CREATE INDEX name_users ON users(name);\n+\n+CREATE TABLE lots (\n+  id INT UNSIGNED AUTO_INCREMENT PRIMARY KEY,\n+  user_id INT UNSIGNED NOT NULL,\n+  category_id INT UNSIGNED NOT NULL,\n+  winner_id INT UNSIGNED NOT NULL,\n+  dt_add DATETIME DEFAULT CURRENT_TIMESTAMP,\n+  name VARCHAR(255) NOT NULL,\n+  description TEXT NOT NULL,\n+  img VARCHAR(255) NOT NULL,\n+  first_price INT UNSIGNED NOT NULL,\n+  expiry_date DATETIME NOT NULL,\n+  step INT UNSIGNED NOT NULL,\n+  FOREIGN KEY (user_id) REFERENCES users(id),\n+  FOREIGN KEY (winner_id) REFERENCES users(id),\n+  FOREIGN KEY (category_id) REFERENCES categories(id)\n+);\n+\n+CREATE INDEX user_id_lots ON lots(user_id);\n+CREATE INDEX category_id_lots ON lots(category_id);\n+CREATE INDEX winner_id_lots ON lots(winner_id);\n+CREATE INDEX dt_add_lots ON lots(dt_add);\n+CREATE INDEX name_lots ON lots(name);\n+CREATE INDEX first_price_lots ON lots(first_price);\n+CREATE INDEX expiry_date_lots ON lots(expiry_date);\n+CREATE INDEX step_lots ON lots(step);","path":"schema.sql","position":50,"original_position":50,"commit_id":"13f5ace9548d01a49a85a27a8377f1337bc57662","original_commit_id":"13f5ace9548d01a49a85a27a8377f1337bc57662","user":{"login":"Shv-sergey70","id":35741647,"node_id":"MDQ6VXNlcjM1NzQxNjQ3","avatar_url":"https://avatars1.githubusercontent.com/u/35741647?v=4","gravatar_id":"","url":"https://api.github.com/users/Shv-sergey70","html_url":"https://github.com/Shv-sergey70","followers_url":"https://api.github.com/users/Shv-sergey70/followers","following_url":"https://api.github.com/users/Shv-sergey70/following{/other_user}","gists_url":"https://api.github.com/users/Shv-sergey70/gists{/gist_id}","starred_url":"https://api.github.com/users/Shv-sergey70/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Shv-sergey70/subscriptions","organizations_url":"https://api.github.com/users/Shv-sergey70/orgs","repos_url":"https://api.github.com/users/Shv-sergey70/repos","events_url":"https://api.github.com/users/Shv-sergey70/events{/privacy}","received_events_url":"https://api.github.com/users/Shv-sergey70/received_events","type":"User","site_admin":false},"body":"Индексы создаются не на все поля в БД, а только на те, по которым ты будешь вести запросы. То есть `join` и `where`","created_at":"2019-11-02T19:19:45Z","updated_at":"2019-11-02T19:21:44Z","html_url":"https://github.com/htmlacademy-php/643755-yeticave-11/pull/7#discussion_r341822808","pull_request_url":"https://api.github.com/repos/htmlacademy-php/643755-yeticave-11/pulls/7","author_association":"NONE","_links":{"self":{"href":"https://api.github.com/repos/htmlacademy-php/643755-yeticave-11/pulls/comments/341822808"},"html":{"href":"https://github.com/htmlacademy-php/643755-yeticave-11/pull/7#discussion_r341822808"},"pull_request":{"href":"https://api.github.com/repos/htmlacademy-php/643755-yeticave-11/pulls/7"}}},"pull_request":{"url":"https://api.github.com/repos/htmlacademy-php/643755-yeticave-11/pulls/7","id":335907273,"node_id":"MDExOlB1bGxSZXF1ZXN0MzM1OTA3Mjcz","html_url":"https://github.com/htmlacademy-php/643755-yeticave-11/pull/7","diff_url":"https://github.com/htmlacademy-php/643755-yeticave-11/pull/7.diff","patch_url":"https://github.com/htmlacademy-php/643755-yeticave-11/pull/7.patch","issue_url":"https://api.github.com/repos/htmlacademy-php/643755-yeticave-11/issues/7","number":7,"state":"open","locked":false,"title":"Создаём схему БД личного проекта","user":{"login":"andikk","id":36851714,"node_id":"MDQ6VXNlcjM2ODUxNzE0","avatar_url":"https://avatars1.githubusercontent.com/u/36851714?v=4","gravatar_id":"","url":"https://api.github.com/users/andikk","html_url":"https://github.com/andikk","followers_url":"https://api.github.com/users/andikk/followers","following_url":"https://api.github.com/users/andikk/following{/other_user}","gists_url":"https://api.github.com/users/andikk/gists{/gist_id}","starred_url":"https://api.github.com/users/andikk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andikk/subscriptions","organizations_url":"https://api.github.com/users/andikk/orgs","repos_url":"https://api.github.com/users/andikk/repos","events_url":"https://api.github.com/users/andikk/events{/privacy}","received_events_url":"https://api.github.com/users/andikk/received_events","type":"User","site_admin":false},"body":"\n\n---\n:mortar_board: [Создаём схему БД личного проекта](https://up.htmlacademy.ru/php/11/user/643755/tasks/8)","created_at":"2019-11-02T18:26:19Z","updated_at":"2019-11-02T19:21:44Z","closed_at":null,"merged_at":null,"merge_commit_sha":"dd3a78fd6bf118e26edeeaad1919374d48ffdbe7","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/htmlacademy-php/643755-yeticave-11/pulls/7/commits","review_comments_url":"https://api.github.com/repos/htmlacademy-php/643755-yeticave-11/pulls/7/comments","review_comment_url":"https://api.github.com/repos/htmlacademy-php/643755-yeticave-11/pulls/comments{/number}","comments_url":"https://api.github.com/repos/htmlacademy-php/643755-yeticave-11/issues/7/comments","statuses_url":"https://api.github.com/repos/htmlacademy-php/643755-yeticave-11/statuses/13f5ace9548d01a49a85a27a8377f1337bc57662","head":{"label":"andikk:module4-task1","ref":"module4-task1","sha":"13f5ace9548d01a49a85a27a8377f1337bc57662","user":{"login":"andikk","id":36851714,"node_id":"MDQ6VXNlcjM2ODUxNzE0","avatar_url":"https://avatars1.githubusercontent.com/u/36851714?v=4","gravatar_id":"","url":"https://api.github.com/users/andikk","html_url":"https://github.com/andikk","followers_url":"https://api.github.com/users/andikk/followers","following_url":"https://api.github.com/users/andikk/following{/other_user}","gists_url":"https://api.github.com/users/andikk/gists{/gist_id}","starred_url":"https://api.github.com/users/andikk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andikk/subscriptions","organizations_url":"https://api.github.com/users/andikk/orgs","repos_url":"https://api.github.com/users/andikk/repos","events_url":"https://api.github.com/users/andikk/events{/privacy}","received_events_url":"https://api.github.com/users/andikk/received_events","type":"User","site_admin":false},"repo":{"id":216880621,"node_id":"MDEwOlJlcG9zaXRvcnkyMTY4ODA2MjE=","name":"643755-yeticave-11","full_name":"andikk/643755-yeticave-11","private":false,"owner":{"login":"andikk","id":36851714,"node_id":"MDQ6VXNlcjM2ODUxNzE0","avatar_url":"https://avatars1.githubusercontent.com/u/36851714?v=4","gravatar_id":"","url":"https://api.github.com/users/andikk","html_url":"https://github.com/andikk","followers_url":"https://api.github.com/users/andikk/followers","following_url":"https://api.github.com/users/andikk/following{/other_user}","gists_url":"https://api.github.com/users/andikk/gists{/gist_id}","starred_url":"https://api.github.com/users/andikk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andikk/subscriptions","organizations_url":"https://api.github.com/users/andikk/orgs","repos_url":"https://api.github.com/users/andikk/repos","events_url":"https://api.github.com/users/andikk/events{/privacy}","received_events_url":"https://api.github.com/users/andikk/received_events","type":"User","site_admin":false},"html_url":"https://github.com/andikk/643755-yeticave-11","description":"Андрей Диканский","fork":true,"url":"https://api.github.com/repos/andikk/643755-yeticave-11","forks_url":"https://api.github.com/repos/andikk/643755-yeticave-11/forks","keys_url":"https://api.github.com/repos/andikk/643755-yeticave-11/keys{/key_id}","collaborators_url":"https://api.github.com/repos/andikk/643755-yeticave-11/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/andikk/643755-yeticave-11/teams","hooks_url":"https://api.github.com/repos/andikk/643755-yeticave-11/hooks","issue_events_url":"https://api.github.com/repos/andikk/643755-yeticave-11/issues/events{/number}","events_url":"https://api.github.com/repos/andikk/643755-yeticave-11/events","assignees_url":"https://api.github.com/repos/andikk/643755-yeticave-11/assignees{/user}","branches_url":"https://api.github.com/repos/andikk/643755-yeticave-11/branches{/branch}","tags_url":"https://api.github.com/repos/andikk/643755-yeticave-11/tags","blobs_url":"https://api.github.com/repos/andikk/643755-yeticave-11/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/andikk/643755-yeticave-11/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/andikk/643755-yeticave-11/git/refs{/sha}","trees_url":"https://api.github.com/repos/andikk/643755-yeticave-11/git/trees{/sha}","statuses_url":"https://api.github.com/repos/andikk/643755-yeticave-11/statuses/{sha}","languages_url":"https://api.github.com/repos/andikk/643755-yeticave-11/languages","stargazers_url":"https://api.github.com/repos/andikk/643755-yeticave-11/stargazers","contributors_url":"https://api.github.com/repos/andikk/643755-yeticave-11/contributors","subscribers_url":"https://api.github.com/repos/andikk/643755-yeticave-11/subscribers","subscription_url":"https://api.github.com/repos/andikk/643755-yeticave-11/subscription","commits_url":"https://api.github.com/repos/andikk/643755-yeticave-11/commits{/sha}","git_commits_url":"https://api.github.com/repos/andikk/643755-yeticave-11/git/commits{/sha}","comments_url":"https://api.github.com/repos/andikk/643755-yeticave-11/comments{/number}","issue_comment_url":"https://api.github.com/repos/andikk/643755-yeticave-11/issues/comments{/number}","contents_url":"https://api.github.com/repos/andikk/643755-yeticave-11/contents/{+path}","compare_url":"https://api.github.com/repos/andikk/643755-yeticave-11/compare/{base}...{head}","merges_url":"https://api.github.com/repos/andikk/643755-yeticave-11/merges","archive_url":"https://api.github.com/repos/andikk/643755-yeticave-11/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/andikk/643755-yeticave-11/downloads","issues_url":"https://api.github.com/repos/andikk/643755-yeticave-11/issues{/number}","pulls_url":"https://api.github.com/repos/andikk/643755-yeticave-11/pulls{/number}","milestones_url":"https://api.github.com/repos/andikk/643755-yeticave-11/milestones{/number}","notifications_url":"https://api.github.com/repos/andikk/643755-yeticave-11/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/andikk/643755-yeticave-11/labels{/name}","releases_url":"https://api.github.com/repos/andikk/643755-yeticave-11/releases{/id}","deployments_url":"https://api.github.com/repos/andikk/643755-yeticave-11/deployments","created_at":"2019-10-22T18:16:27Z","updated_at":"2019-11-02T15:51:58Z","pushed_at":"2019-11-02T18:25:47Z","git_url":"git://github.com/andikk/643755-yeticave-11.git","ssh_url":"git@github.com:andikk/643755-yeticave-11.git","clone_url":"https://github.com/andikk/643755-yeticave-11.git","svn_url":"https://github.com/andikk/643755-yeticave-11","homepage":null,"size":593,"stargazers_count":0,"watchers_count":0,"language":"HTML","has_issues":false,"has_projects":true,"has_downloads":false,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"disabled":false,"open_issues_count":0,"license":null,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"htmlacademy-php:master","ref":"master","sha":"2bdae68e7e3a80c392bf461104b384a921908915","user":{"login":"htmlacademy-php","id":27206120,"node_id":"MDEyOk9yZ2FuaXphdGlvbjI3MjA2MTIw","avatar_url":"https://avatars1.githubusercontent.com/u/27206120?v=4","gravatar_id":"","url":"https://api.github.com/users/htmlacademy-php","html_url":"https://github.com/htmlacademy-php","followers_url":"https://api.github.com/users/htmlacademy-php/followers","following_url":"https://api.github.com/users/htmlacademy-php/following{/other_user}","gists_url":"https://api.github.com/users/htmlacademy-php/gists{/gist_id}","starred_url":"https://api.github.com/users/htmlacademy-php/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/htmlacademy-php/subscriptions","organizations_url":"https://api.github.com/users/htmlacademy-php/orgs","repos_url":"https://api.github.com/users/htmlacademy-php/repos","events_url":"https://api.github.com/users/htmlacademy-php/events{/privacy}","received_events_url":"https://api.github.com/users/htmlacademy-php/received_events","type":"Organization","site_admin":false},"repo":{"id":216879946,"node_id":"MDEwOlJlcG9zaXRvcnkyMTY4Nzk5NDY=","name":"643755-yeticave-11","full_name":"htmlacademy-php/643755-yeticave-11","private":false,"owner":{"login":"htmlacademy-php","id":27206120,"node_id":"MDEyOk9yZ2FuaXphdGlvbjI3MjA2MTIw","avatar_url":"https://avatars1.githubusercontent.com/u/27206120?v=4","gravatar_id":"","url":"https://api.github.com/users/htmlacademy-php","html_url":"https://github.com/htmlacademy-php","followers_url":"https://api.github.com/users/htmlacademy-php/followers","following_url":"https://api.github.com/users/htmlacademy-php/following{/other_user}","gists_url":"https://api.github.com/users/htmlacademy-php/gists{/gist_id}","starred_url":"https://api.github.com/users/htmlacademy-php/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/htmlacademy-php/subscriptions","organizations_url":"https://api.github.com/users/htmlacademy-php/orgs","repos_url":"https://api.github.com/users/htmlacademy-php/repos","events_url":"https://api.github.com/users/htmlacademy-php/events{/privacy}","received_events_url":"https://api.github.com/users/htmlacademy-php/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/htmlacademy-php/643755-yeticave-11","description":"Андрей Диканский","fork":false,"url":"https://api.github.com/repos/htmlacademy-php/643755-yeticave-11","forks_url":"https://api.github.com/repos/htmlacademy-php/643755-yeticave-11/forks","keys_url":"https://api.github.com/repos/htmlacademy-php/643755-yeticave-11/keys{/key_id}","collaborators_url":"https://api.github.com/repos/htmlacademy-php/643755-yeticave-11/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/htmlacademy-php/643755-yeticave-11/teams","hooks_url":"https://api.github.com/repos/htmlacademy-php/643755-yeticave-11/hooks","issue_events_url":"https://api.github.com/repos/htmlacademy-php/643755-yeticave-11/issues/events{/number}","events_url":"https://api.github.com/repos/htmlacademy-php/643755-yeticave-11/events","assignees_url":"https://api.github.com/repos/htmlacademy-php/643755-yeticave-11/assignees{/user}","branches_url":"https://api.github.com/repos/htmlacademy-php/643755-yeticave-11/branches{/branch}","tags_url":"https://api.github.com/repos/htmlacademy-php/643755-yeticave-11/tags","blobs_url":"https://api.github.com/repos/htmlacademy-php/643755-yeticave-11/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/htmlacademy-php/643755-yeticave-11/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/htmlacademy-php/643755-yeticave-11/git/refs{/sha}","trees_url":"https://api.github.com/repos/htmlacademy-php/643755-yeticave-11/git/trees{/sha}","statuses_url":"https://api.github.com/repos/htmlacademy-php/643755-yeticave-11/statuses/{sha}","languages_url":"https://api.github.com/repos/htmlacademy-php/643755-yeticave-11/languages","stargazers_url":"https://api.github.com/repos/htmlacademy-php/643755-yeticave-11/stargazers","contributors_url":"https://api.github.com/repos/htmlacademy-php/643755-yeticave-11/contributors","subscribers_url":"https://api.github.com/repos/htmlacademy-php/643755-yeticave-11/subscribers","subscription_url":"https://api.github.com/repos/htmlacademy-php/643755-yeticave-11/subscription","commits_url":"https://api.github.com/repos/htmlacademy-php/643755-yeticave-11/commits{/sha}","git_commits_url":"https://api.github.com/repos/htmlacademy-php/643755-yeticave-11/git/commits{/sha}","comments_url":"https://api.github.com/repos/htmlacademy-php/643755-yeticave-11/comments{/number}","issue_comment_url":"https://api.github.com/repos/htmlacademy-php/643755-yeticave-11/issues/comments{/number}","contents_url":"https://api.github.com/repos/htmlacademy-php/643755-yeticave-11/contents/{+path}","compare_url":"https://api.github.com/repos/htmlacademy-php/643755-yeticave-11/compare/{base}...{head}","merges_url":"https://api.github.com/repos/htmlacademy-php/643755-yeticave-11/merges","archive_url":"https://api.github.com/repos/htmlacademy-php/643755-yeticave-11/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/htmlacademy-php/643755-yeticave-11/downloads","issues_url":"https://api.github.com/repos/htmlacademy-php/643755-yeticave-11/issues{/number}","pulls_url":"https://api.github.com/repos/htmlacademy-php/643755-yeticave-11/pulls{/number}","milestones_url":"https://api.github.com/repos/htmlacademy-php/643755-yeticave-11/milestones{/number}","notifications_url":"https://api.github.com/repos/htmlacademy-php/643755-yeticave-11/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/htmlacademy-php/643755-yeticave-11/labels{/name}","releases_url":"https://api.github.com/repos/htmlacademy-php/643755-yeticave-11/releases{/id}","deployments_url":"https://api.github.com/repos/htmlacademy-php/643755-yeticave-11/deployments","created_at":"2019-10-22T18:12:31Z","updated_at":"2019-11-01T06:54:46Z","pushed_at":"2019-11-02T18:26:20Z","git_url":"git://github.com/htmlacademy-php/643755-yeticave-11.git","ssh_url":"git@github.com:htmlacademy-php/643755-yeticave-11.git","clone_url":"https://github.com/htmlacademy-php/643755-yeticave-11.git","svn_url":"https://github.com/htmlacademy-php/643755-yeticave-11","homepage":"https://github.com/andikk/643755-yeticave-11","size":593,"stargazers_count":0,"watchers_count":0,"language":"HTML","has_issues":false,"has_projects":true,"has_downloads":false,"has_wiki":false,"has_pages":false,"forks_count":1,"mirror_url":null,"archived":false,"disabled":false,"open_issues_count":1,"license":null,"forks":1,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/htmlacademy-php/643755-yeticave-11/pulls/7"},"html":{"href":"https://github.com/htmlacademy-php/643755-yeticave-11/pull/7"},"issue":{"href":"https://api.github.com/repos/htmlacademy-php/643755-yeticave-11/issues/7"},"comments":{"href":"https://api.github.com/repos/htmlacademy-php/643755-yeticave-11/issues/7/comments"},"review_comments":{"href":"https://api.github.com/repos/htmlacademy-php/643755-yeticave-11/pulls/7/comments"},"review_comment":{"href":"https://api.github.com/repos/htmlacademy-php/643755-yeticave-11/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/htmlacademy-php/643755-yeticave-11/pulls/7/commits"},"statuses":{"href":"https://api.github.com/repos/htmlacademy-php/643755-yeticave-11/statuses/13f5ace9548d01a49a85a27a8377f1337bc57662"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"Shv-sergey70"}}