{"action":"closed","number":16,"pull_request":{"url":"https://api.github.com/repos/Wikia/python-commons/pulls/16","id":86348078,"html_url":"https://github.com/Wikia/python-commons/pull/16","diff_url":"https://github.com/Wikia/python-commons/pull/16.diff","patch_url":"https://github.com/Wikia/python-commons/pull/16.patch","issue_url":"https://api.github.com/repos/Wikia/python-commons/issues/16","number":16,"state":"closed","locked":false,"title":"SqlBuilderMixin: wrap column names in backticks","user":{"login":"macbre","id":1929317,"avatar_url":"https://avatars.githubusercontent.com/u/1929317?v=3","gravatar_id":"","url":"https://api.github.com/users/macbre","html_url":"https://github.com/macbre","followers_url":"https://api.github.com/users/macbre/followers","following_url":"https://api.github.com/users/macbre/following{/other_user}","gists_url":"https://api.github.com/users/macbre/gists{/gist_id}","starred_url":"https://api.github.com/users/macbre/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/macbre/subscriptions","organizations_url":"https://api.github.com/users/macbre/orgs","repos_url":"https://api.github.com/users/macbre/repos","events_url":"https://api.github.com/users/macbre/events{/privacy}","received_events_url":"https://api.github.com/users/macbre/received_events","type":"User","site_admin":false},"body":"We have tables that have `order` column, let's wrap column names in backticks when performing `INSERT` query.\r\n\r\n```sql\r\nINSERT IGNORE INTO vpt_asset(asset_id, updated_by, section, updated_at, program_id, data, order) VALUES (%(asset_id)s, %(updated_by)s, %(section)s, %(updated_at)s, %(program_id)s, %(data)s, %(order)s);\r\n```\r\n\r\n```sql\r\nCREATE TABLE `vpt_asset` (\r\n  `asset_id` int(10) unsigned NOT NULL AUTO_INCREMENT,\r\n  `program_id` int(10) unsigned NOT NULL,\r\n  `section` varchar(255) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '',\r\n  `order` tinyint(4) NOT NULL DEFAULT '1',\r\n  `data` blob NOT NULL,\r\n  `updated_by` int(10) unsigned NOT NULL,\r\n  `updated_at` datetime NOT NULL,\r\n  PRIMARY KEY (`asset_id`),\r\n  UNIQUE KEY `asset` (`program_id`,`section`,`order`),\r\n  KEY `program_id` (`program_id`,`section`)\r\n) ENGINE=InnoDB DEFAULT CHARSET=latin1;\r\n```\r\n\r\n@wladekb ","created_at":"2016-09-22T14:26:53Z","updated_at":"2016-09-23T08:26:51Z","closed_at":"2016-09-23T08:26:51Z","merged_at":"2016-09-23T08:26:51Z","merge_commit_sha":"258beb6135462c99f8c6605b41b3a9500aa8f159","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/Wikia/python-commons/pulls/16/commits","review_comments_url":"https://api.github.com/repos/Wikia/python-commons/pulls/16/comments","review_comment_url":"https://api.github.com/repos/Wikia/python-commons/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Wikia/python-commons/issues/16/comments","statuses_url":"https://api.github.com/repos/Wikia/python-commons/statuses/9bf2479757ebd35086b211b8cce7a6a09ff25548","head":{"label":"Wikia:SqlBuilderMixin-columns-handling","ref":"SqlBuilderMixin-columns-handling","sha":"9bf2479757ebd35086b211b8cce7a6a09ff25548","user":{"login":"Wikia","id":1171011,"avatar_url":"https://avatars.githubusercontent.com/u/1171011?v=3","gravatar_id":"","url":"https://api.github.com/users/Wikia","html_url":"https://github.com/Wikia","followers_url":"https://api.github.com/users/Wikia/followers","following_url":"https://api.github.com/users/Wikia/following{/other_user}","gists_url":"https://api.github.com/users/Wikia/gists{/gist_id}","starred_url":"https://api.github.com/users/Wikia/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Wikia/subscriptions","organizations_url":"https://api.github.com/users/Wikia/orgs","repos_url":"https://api.github.com/users/Wikia/repos","events_url":"https://api.github.com/users/Wikia/events{/privacy}","received_events_url":"https://api.github.com/users/Wikia/received_events","type":"Organization","site_admin":false},"repo":{"id":20072017,"name":"python-commons","full_name":"Wikia/python-commons","owner":{"login":"Wikia","id":1171011,"avatar_url":"https://avatars.githubusercontent.com/u/1171011?v=3","gravatar_id":"","url":"https://api.github.com/users/Wikia","html_url":"https://github.com/Wikia","followers_url":"https://api.github.com/users/Wikia/followers","following_url":"https://api.github.com/users/Wikia/following{/other_user}","gists_url":"https://api.github.com/users/Wikia/gists{/gist_id}","starred_url":"https://api.github.com/users/Wikia/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Wikia/subscriptions","organizations_url":"https://api.github.com/users/Wikia/orgs","repos_url":"https://api.github.com/users/Wikia/repos","events_url":"https://api.github.com/users/Wikia/events{/privacy}","received_events_url":"https://api.github.com/users/Wikia/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Wikia/python-commons","description":"Common Python libraries to share between projects at Wikia","fork":false,"url":"https://api.github.com/repos/Wikia/python-commons","forks_url":"https://api.github.com/repos/Wikia/python-commons/forks","keys_url":"https://api.github.com/repos/Wikia/python-commons/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Wikia/python-commons/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Wikia/python-commons/teams","hooks_url":"https://api.github.com/repos/Wikia/python-commons/hooks","issue_events_url":"https://api.github.com/repos/Wikia/python-commons/issues/events{/number}","events_url":"https://api.github.com/repos/Wikia/python-commons/events","assignees_url":"https://api.github.com/repos/Wikia/python-commons/assignees{/user}","branches_url":"https://api.github.com/repos/Wikia/python-commons/branches{/branch}","tags_url":"https://api.github.com/repos/Wikia/python-commons/tags","blobs_url":"https://api.github.com/repos/Wikia/python-commons/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Wikia/python-commons/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Wikia/python-commons/git/refs{/sha}","trees_url":"https://api.github.com/repos/Wikia/python-commons/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Wikia/python-commons/statuses/{sha}","languages_url":"https://api.github.com/repos/Wikia/python-commons/languages","stargazers_url":"https://api.github.com/repos/Wikia/python-commons/stargazers","contributors_url":"https://api.github.com/repos/Wikia/python-commons/contributors","subscribers_url":"https://api.github.com/repos/Wikia/python-commons/subscribers","subscription_url":"https://api.github.com/repos/Wikia/python-commons/subscription","commits_url":"https://api.github.com/repos/Wikia/python-commons/commits{/sha}","git_commits_url":"https://api.github.com/repos/Wikia/python-commons/git/commits{/sha}","comments_url":"https://api.github.com/repos/Wikia/python-commons/comments{/number}","issue_comment_url":"https://api.github.com/repos/Wikia/python-commons/issues/comments{/number}","contents_url":"https://api.github.com/repos/Wikia/python-commons/contents/{+path}","compare_url":"https://api.github.com/repos/Wikia/python-commons/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Wikia/python-commons/merges","archive_url":"https://api.github.com/repos/Wikia/python-commons/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Wikia/python-commons/downloads","issues_url":"https://api.github.com/repos/Wikia/python-commons/issues{/number}","pulls_url":"https://api.github.com/repos/Wikia/python-commons/pulls{/number}","milestones_url":"https://api.github.com/repos/Wikia/python-commons/milestones{/number}","notifications_url":"https://api.github.com/repos/Wikia/python-commons/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Wikia/python-commons/labels{/name}","releases_url":"https://api.github.com/repos/Wikia/python-commons/releases{/id}","deployments_url":"https://api.github.com/repos/Wikia/python-commons/deployments","created_at":"2014-05-22T18:21:40Z","updated_at":"2016-09-10T10:42:46Z","pushed_at":"2016-09-23T08:26:51Z","git_url":"git://github.com/Wikia/python-commons.git","ssh_url":"git@github.com:Wikia/python-commons.git","clone_url":"https://github.com/Wikia/python-commons.git","svn_url":"https://github.com/Wikia/python-commons","homepage":"","size":89,"stargazers_count":1,"watchers_count":1,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":3,"mirror_url":null,"open_issues_count":0,"forks":3,"open_issues":0,"watchers":1,"default_branch":"master"}},"base":{"label":"Wikia:master","ref":"master","sha":"b4d491838ff105fd9cd89e32cb4f1c28634a3eba","user":{"login":"Wikia","id":1171011,"avatar_url":"https://avatars.githubusercontent.com/u/1171011?v=3","gravatar_id":"","url":"https://api.github.com/users/Wikia","html_url":"https://github.com/Wikia","followers_url":"https://api.github.com/users/Wikia/followers","following_url":"https://api.github.com/users/Wikia/following{/other_user}","gists_url":"https://api.github.com/users/Wikia/gists{/gist_id}","starred_url":"https://api.github.com/users/Wikia/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Wikia/subscriptions","organizations_url":"https://api.github.com/users/Wikia/orgs","repos_url":"https://api.github.com/users/Wikia/repos","events_url":"https://api.github.com/users/Wikia/events{/privacy}","received_events_url":"https://api.github.com/users/Wikia/received_events","type":"Organization","site_admin":false},"repo":{"id":20072017,"name":"python-commons","full_name":"Wikia/python-commons","owner":{"login":"Wikia","id":1171011,"avatar_url":"https://avatars.githubusercontent.com/u/1171011?v=3","gravatar_id":"","url":"https://api.github.com/users/Wikia","html_url":"https://github.com/Wikia","followers_url":"https://api.github.com/users/Wikia/followers","following_url":"https://api.github.com/users/Wikia/following{/other_user}","gists_url":"https://api.github.com/users/Wikia/gists{/gist_id}","starred_url":"https://api.github.com/users/Wikia/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Wikia/subscriptions","organizations_url":"https://api.github.com/users/Wikia/orgs","repos_url":"https://api.github.com/users/Wikia/repos","events_url":"https://api.github.com/users/Wikia/events{/privacy}","received_events_url":"https://api.github.com/users/Wikia/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Wikia/python-commons","description":"Common Python libraries to share between projects at Wikia","fork":false,"url":"https://api.github.com/repos/Wikia/python-commons","forks_url":"https://api.github.com/repos/Wikia/python-commons/forks","keys_url":"https://api.github.com/repos/Wikia/python-commons/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Wikia/python-commons/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Wikia/python-commons/teams","hooks_url":"https://api.github.com/repos/Wikia/python-commons/hooks","issue_events_url":"https://api.github.com/repos/Wikia/python-commons/issues/events{/number}","events_url":"https://api.github.com/repos/Wikia/python-commons/events","assignees_url":"https://api.github.com/repos/Wikia/python-commons/assignees{/user}","branches_url":"https://api.github.com/repos/Wikia/python-commons/branches{/branch}","tags_url":"https://api.github.com/repos/Wikia/python-commons/tags","blobs_url":"https://api.github.com/repos/Wikia/python-commons/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Wikia/python-commons/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Wikia/python-commons/git/refs{/sha}","trees_url":"https://api.github.com/repos/Wikia/python-commons/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Wikia/python-commons/statuses/{sha}","languages_url":"https://api.github.com/repos/Wikia/python-commons/languages","stargazers_url":"https://api.github.com/repos/Wikia/python-commons/stargazers","contributors_url":"https://api.github.com/repos/Wikia/python-commons/contributors","subscribers_url":"https://api.github.com/repos/Wikia/python-commons/subscribers","subscription_url":"https://api.github.com/repos/Wikia/python-commons/subscription","commits_url":"https://api.github.com/repos/Wikia/python-commons/commits{/sha}","git_commits_url":"https://api.github.com/repos/Wikia/python-commons/git/commits{/sha}","comments_url":"https://api.github.com/repos/Wikia/python-commons/comments{/number}","issue_comment_url":"https://api.github.com/repos/Wikia/python-commons/issues/comments{/number}","contents_url":"https://api.github.com/repos/Wikia/python-commons/contents/{+path}","compare_url":"https://api.github.com/repos/Wikia/python-commons/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Wikia/python-commons/merges","archive_url":"https://api.github.com/repos/Wikia/python-commons/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Wikia/python-commons/downloads","issues_url":"https://api.github.com/repos/Wikia/python-commons/issues{/number}","pulls_url":"https://api.github.com/repos/Wikia/python-commons/pulls{/number}","milestones_url":"https://api.github.com/repos/Wikia/python-commons/milestones{/number}","notifications_url":"https://api.github.com/repos/Wikia/python-commons/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Wikia/python-commons/labels{/name}","releases_url":"https://api.github.com/repos/Wikia/python-commons/releases{/id}","deployments_url":"https://api.github.com/repos/Wikia/python-commons/deployments","created_at":"2014-05-22T18:21:40Z","updated_at":"2016-09-10T10:42:46Z","pushed_at":"2016-09-23T08:26:51Z","git_url":"git://github.com/Wikia/python-commons.git","ssh_url":"git@github.com:Wikia/python-commons.git","clone_url":"https://github.com/Wikia/python-commons.git","svn_url":"https://github.com/Wikia/python-commons","homepage":"","size":89,"stargazers_count":1,"watchers_count":1,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":3,"mirror_url":null,"open_issues_count":0,"forks":3,"open_issues":0,"watchers":1,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Wikia/python-commons/pulls/16"},"html":{"href":"https://github.com/Wikia/python-commons/pull/16"},"issue":{"href":"https://api.github.com/repos/Wikia/python-commons/issues/16"},"comments":{"href":"https://api.github.com/repos/Wikia/python-commons/issues/16/comments"},"review_comments":{"href":"https://api.github.com/repos/Wikia/python-commons/pulls/16/comments"},"review_comment":{"href":"https://api.github.com/repos/Wikia/python-commons/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Wikia/python-commons/pulls/16/commits"},"statuses":{"href":"https://api.github.com/repos/Wikia/python-commons/statuses/9bf2479757ebd35086b211b8cce7a6a09ff25548"}},"merged":true,"mergeable":null,"mergeable_state":"unknown","merged_by":{"login":"macbre","id":1929317,"avatar_url":"https://avatars.githubusercontent.com/u/1929317?v=3","gravatar_id":"","url":"https://api.github.com/users/macbre","html_url":"https://github.com/macbre","followers_url":"https://api.github.com/users/macbre/followers","following_url":"https://api.github.com/users/macbre/following{/other_user}","gists_url":"https://api.github.com/users/macbre/gists{/gist_id}","starred_url":"https://api.github.com/users/macbre/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/macbre/subscriptions","organizations_url":"https://api.github.com/users/macbre/orgs","repos_url":"https://api.github.com/users/macbre/repos","events_url":"https://api.github.com/users/macbre/events{/privacy}","received_events_url":"https://api.github.com/users/macbre/received_events","type":"User","site_admin":false},"comments":0,"review_comments":2,"commits":1,"additions":3,"deletions":2,"changed_files":3}}
{"actor":{"display_login":"macbre"}}