{"action":"created","comment":{"url":"https://api.github.com/repos/rails/rails/pulls/comments/39928017","id":39928017,"diff_hunk":"@@ -1163,8 +1187,9 @@ def create_table_definition(name, temporary = false, options = nil, as = nil) #\n       def binary_to_sql(limit) # :nodoc:\n         case limit\n         when 0..0xfff;           \"varbinary(#{limit})\"\n-        when nil;                \"blob\"\n-        when 0x1000..0xffffffff; \"blob(#{limit})\"\n+        when nil, 0x1000..0xffff;   'blob'\n+        when 0x10000..0xffffff;     'mediumblob'\n+        when 0x1000000..0xffffffff; 'longblob'","path":"activerecord/lib/active_record/connection_adapters/abstract_mysql_adapter.rb","position":39,"original_position":39,"commit_id":"e6be15bb8e028cb1b4e964f90a1bc4ad5e34871c","original_commit_id":"e6be15bb8e028cb1b4e964f90a1bc4ad5e34871c","user":{"login":"matthewd","id":1034,"avatar_url":"https://avatars.githubusercontent.com/u/1034?v=3","gravatar_id":"","url":"https://api.github.com/users/matthewd","html_url":"https://github.com/matthewd","followers_url":"https://api.github.com/users/matthewd/followers","following_url":"https://api.github.com/users/matthewd/following{/other_user}","gists_url":"https://api.github.com/users/matthewd/gists{/gist_id}","starred_url":"https://api.github.com/users/matthewd/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/matthewd/subscriptions","organizations_url":"https://api.github.com/users/matthewd/orgs","repos_url":"https://api.github.com/users/matthewd/repos","events_url":"https://api.github.com/users/matthewd/events{/privacy}","received_events_url":"https://api.github.com/users/matthewd/received_events","type":"User","site_admin":false},"body":"Why this change? It seems better to leave this up to MySQL to me.","created_at":"2015-09-20T08:56:58Z","updated_at":"2015-09-20T08:56:58Z","html_url":"https://github.com/rails/rails/pull/21688#discussion_r39928017","pull_request_url":"https://api.github.com/repos/rails/rails/pulls/21688","_links":{"self":{"href":"https://api.github.com/repos/rails/rails/pulls/comments/39928017"},"html":{"href":"https://github.com/rails/rails/pull/21688#discussion_r39928017"},"pull_request":{"href":"https://api.github.com/repos/rails/rails/pulls/21688"}}},"pull_request":{"url":"https://api.github.com/repos/rails/rails/pulls/21688","id":45491341,"html_url":"https://github.com/rails/rails/pull/21688","diff_url":"https://github.com/rails/rails/pull/21688.diff","patch_url":"https://github.com/rails/rails/pull/21688.patch","issue_url":"https://api.github.com/repos/rails/rails/issues/21688","number":21688,"state":"open","locked":false,"title":"Add short-hand methods for text and blob types in MySQL","user":{"login":"kamipo","id":12642,"avatar_url":"https://avatars.githubusercontent.com/u/12642?v=3","gravatar_id":"","url":"https://api.github.com/users/kamipo","html_url":"https://github.com/kamipo","followers_url":"https://api.github.com/users/kamipo/followers","following_url":"https://api.github.com/users/kamipo/following{/other_user}","gists_url":"https://api.github.com/users/kamipo/gists{/gist_id}","starred_url":"https://api.github.com/users/kamipo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kamipo/subscriptions","organizations_url":"https://api.github.com/users/kamipo/orgs","repos_url":"https://api.github.com/users/kamipo/repos","events_url":"https://api.github.com/users/kamipo/events{/privacy}","received_events_url":"https://api.github.com/users/kamipo/received_events","type":"User","site_admin":false},"body":"In Pg and Sqlite3, `:text` and `:binary` have variable unlimited length.\r\nBut in MySQL, these have limited length for each types (see also #21591, #21619).\r\nThis change adds short-hand methods for each text and blob types.\r\n\r\nBefore:\r\n\r\n```ruby\r\ncreate_table :foos do |t|\r\n  t.column :tiny_blob, 'tinyblob'\r\n  t.binary :medium_blob, limit: 16777215\r\n  t.binary :long_blob,   limit: 2147483647\r\n  t.text   :tiny_text,   limit: 255\r\n  t.text   :medium_text, limit: 16777215\r\n  t.text   :long_text,   limit: 2147483647\r\nend\r\n```\r\n\r\nShort-hand methods:\r\n\r\n```ruby\r\ncreate_table :foos do |t|\r\n  t.tinyblob   :tiny_blob\r\n  t.mediumblob :medium_blob\r\n  t.longblob   :long_blob\r\n  t.tinytext   :tiny_text\r\n  t.mediumtext :medium_text\r\n  t.longtext   :long_text\r\nend\r\n```","created_at":"2015-09-20T07:07:57Z","updated_at":"2015-09-20T08:56:59Z","closed_at":null,"merged_at":null,"merge_commit_sha":"ea17de26e0cdd56e822b83b03f6e4411ba62b493","assignee":{"login":"arthurnn","id":833383,"avatar_url":"https://avatars.githubusercontent.com/u/833383?v=3","gravatar_id":"","url":"https://api.github.com/users/arthurnn","html_url":"https://github.com/arthurnn","followers_url":"https://api.github.com/users/arthurnn/followers","following_url":"https://api.github.com/users/arthurnn/following{/other_user}","gists_url":"https://api.github.com/users/arthurnn/gists{/gist_id}","starred_url":"https://api.github.com/users/arthurnn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/arthurnn/subscriptions","organizations_url":"https://api.github.com/users/arthurnn/orgs","repos_url":"https://api.github.com/users/arthurnn/repos","events_url":"https://api.github.com/users/arthurnn/events{/privacy}","received_events_url":"https://api.github.com/users/arthurnn/received_events","type":"User","site_admin":true},"milestone":null,"commits_url":"https://api.github.com/repos/rails/rails/pulls/21688/commits","review_comments_url":"https://api.github.com/repos/rails/rails/pulls/21688/comments","review_comment_url":"https://api.github.com/repos/rails/rails/pulls/comments{/number}","comments_url":"https://api.github.com/repos/rails/rails/issues/21688/comments","statuses_url":"https://api.github.com/repos/rails/rails/statuses/e6be15bb8e028cb1b4e964f90a1bc4ad5e34871c","head":{"label":"kamipo:add_text_and_blob_shorthand_methods","ref":"add_text_and_blob_shorthand_methods","sha":"e6be15bb8e028cb1b4e964f90a1bc4ad5e34871c","user":{"login":"kamipo","id":12642,"avatar_url":"https://avatars.githubusercontent.com/u/12642?v=3","gravatar_id":"","url":"https://api.github.com/users/kamipo","html_url":"https://github.com/kamipo","followers_url":"https://api.github.com/users/kamipo/followers","following_url":"https://api.github.com/users/kamipo/following{/other_user}","gists_url":"https://api.github.com/users/kamipo/gists{/gist_id}","starred_url":"https://api.github.com/users/kamipo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kamipo/subscriptions","organizations_url":"https://api.github.com/users/kamipo/orgs","repos_url":"https://api.github.com/users/kamipo/repos","events_url":"https://api.github.com/users/kamipo/events{/privacy}","received_events_url":"https://api.github.com/users/kamipo/received_events","type":"User","site_admin":false},"repo":{"id":14544189,"name":"rails","full_name":"kamipo/rails","owner":{"login":"kamipo","id":12642,"avatar_url":"https://avatars.githubusercontent.com/u/12642?v=3","gravatar_id":"","url":"https://api.github.com/users/kamipo","html_url":"https://github.com/kamipo","followers_url":"https://api.github.com/users/kamipo/followers","following_url":"https://api.github.com/users/kamipo/following{/other_user}","gists_url":"https://api.github.com/users/kamipo/gists{/gist_id}","starred_url":"https://api.github.com/users/kamipo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kamipo/subscriptions","organizations_url":"https://api.github.com/users/kamipo/orgs","repos_url":"https://api.github.com/users/kamipo/repos","events_url":"https://api.github.com/users/kamipo/events{/privacy}","received_events_url":"https://api.github.com/users/kamipo/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/kamipo/rails","description":"Ruby on Rails","fork":true,"url":"https://api.github.com/repos/kamipo/rails","forks_url":"https://api.github.com/repos/kamipo/rails/forks","keys_url":"https://api.github.com/repos/kamipo/rails/keys{/key_id}","collaborators_url":"https://api.github.com/repos/kamipo/rails/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/kamipo/rails/teams","hooks_url":"https://api.github.com/repos/kamipo/rails/hooks","issue_events_url":"https://api.github.com/repos/kamipo/rails/issues/events{/number}","events_url":"https://api.github.com/repos/kamipo/rails/events","assignees_url":"https://api.github.com/repos/kamipo/rails/assignees{/user}","branches_url":"https://api.github.com/repos/kamipo/rails/branches{/branch}","tags_url":"https://api.github.com/repos/kamipo/rails/tags","blobs_url":"https://api.github.com/repos/kamipo/rails/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/kamipo/rails/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/kamipo/rails/git/refs{/sha}","trees_url":"https://api.github.com/repos/kamipo/rails/git/trees{/sha}","statuses_url":"https://api.github.com/repos/kamipo/rails/statuses/{sha}","languages_url":"https://api.github.com/repos/kamipo/rails/languages","stargazers_url":"https://api.github.com/repos/kamipo/rails/stargazers","contributors_url":"https://api.github.com/repos/kamipo/rails/contributors","subscribers_url":"https://api.github.com/repos/kamipo/rails/subscribers","subscription_url":"https://api.github.com/repos/kamipo/rails/subscription","commits_url":"https://api.github.com/repos/kamipo/rails/commits{/sha}","git_commits_url":"https://api.github.com/repos/kamipo/rails/git/commits{/sha}","comments_url":"https://api.github.com/repos/kamipo/rails/comments{/number}","issue_comment_url":"https://api.github.com/repos/kamipo/rails/issues/comments{/number}","contents_url":"https://api.github.com/repos/kamipo/rails/contents/{+path}","compare_url":"https://api.github.com/repos/kamipo/rails/compare/{base}...{head}","merges_url":"https://api.github.com/repos/kamipo/rails/merges","archive_url":"https://api.github.com/repos/kamipo/rails/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/kamipo/rails/downloads","issues_url":"https://api.github.com/repos/kamipo/rails/issues{/number}","pulls_url":"https://api.github.com/repos/kamipo/rails/pulls{/number}","milestones_url":"https://api.github.com/repos/kamipo/rails/milestones{/number}","notifications_url":"https://api.github.com/repos/kamipo/rails/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/kamipo/rails/labels{/name}","releases_url":"https://api.github.com/repos/kamipo/rails/releases{/id}","created_at":"2013-11-20T02:14:22Z","updated_at":"2015-02-16T07:18:13Z","pushed_at":"2015-09-20T07:10:47Z","git_url":"git://github.com/kamipo/rails.git","ssh_url":"git@github.com:kamipo/rails.git","clone_url":"https://github.com/kamipo/rails.git","svn_url":"https://github.com/kamipo/rails","homepage":"http://rubyonrails.org","size":140232,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":false,"has_downloads":true,"has_wiki":false,"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":"rails:master","ref":"master","sha":"9d1aae5c5fc217fd463a643d4be9e10cae079947","user":{"login":"rails","id":4223,"avatar_url":"https://avatars.githubusercontent.com/u/4223?v=3","gravatar_id":"","url":"https://api.github.com/users/rails","html_url":"https://github.com/rails","followers_url":"https://api.github.com/users/rails/followers","following_url":"https://api.github.com/users/rails/following{/other_user}","gists_url":"https://api.github.com/users/rails/gists{/gist_id}","starred_url":"https://api.github.com/users/rails/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rails/subscriptions","organizations_url":"https://api.github.com/users/rails/orgs","repos_url":"https://api.github.com/users/rails/repos","events_url":"https://api.github.com/users/rails/events{/privacy}","received_events_url":"https://api.github.com/users/rails/received_events","type":"Organization","site_admin":false},"repo":{"id":8514,"name":"rails","full_name":"rails/rails","owner":{"login":"rails","id":4223,"avatar_url":"https://avatars.githubusercontent.com/u/4223?v=3","gravatar_id":"","url":"https://api.github.com/users/rails","html_url":"https://github.com/rails","followers_url":"https://api.github.com/users/rails/followers","following_url":"https://api.github.com/users/rails/following{/other_user}","gists_url":"https://api.github.com/users/rails/gists{/gist_id}","starred_url":"https://api.github.com/users/rails/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rails/subscriptions","organizations_url":"https://api.github.com/users/rails/orgs","repos_url":"https://api.github.com/users/rails/repos","events_url":"https://api.github.com/users/rails/events{/privacy}","received_events_url":"https://api.github.com/users/rails/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/rails/rails","description":"Ruby on Rails","fork":false,"url":"https://api.github.com/repos/rails/rails","forks_url":"https://api.github.com/repos/rails/rails/forks","keys_url":"https://api.github.com/repos/rails/rails/keys{/key_id}","collaborators_url":"https://api.github.com/repos/rails/rails/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/rails/rails/teams","hooks_url":"https://api.github.com/repos/rails/rails/hooks","issue_events_url":"https://api.github.com/repos/rails/rails/issues/events{/number}","events_url":"https://api.github.com/repos/rails/rails/events","assignees_url":"https://api.github.com/repos/rails/rails/assignees{/user}","branches_url":"https://api.github.com/repos/rails/rails/branches{/branch}","tags_url":"https://api.github.com/repos/rails/rails/tags","blobs_url":"https://api.github.com/repos/rails/rails/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/rails/rails/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/rails/rails/git/refs{/sha}","trees_url":"https://api.github.com/repos/rails/rails/git/trees{/sha}","statuses_url":"https://api.github.com/repos/rails/rails/statuses/{sha}","languages_url":"https://api.github.com/repos/rails/rails/languages","stargazers_url":"https://api.github.com/repos/rails/rails/stargazers","contributors_url":"https://api.github.com/repos/rails/rails/contributors","subscribers_url":"https://api.github.com/repos/rails/rails/subscribers","subscription_url":"https://api.github.com/repos/rails/rails/subscription","commits_url":"https://api.github.com/repos/rails/rails/commits{/sha}","git_commits_url":"https://api.github.com/repos/rails/rails/git/commits{/sha}","comments_url":"https://api.github.com/repos/rails/rails/comments{/number}","issue_comment_url":"https://api.github.com/repos/rails/rails/issues/comments{/number}","contents_url":"https://api.github.com/repos/rails/rails/contents/{+path}","compare_url":"https://api.github.com/repos/rails/rails/compare/{base}...{head}","merges_url":"https://api.github.com/repos/rails/rails/merges","archive_url":"https://api.github.com/repos/rails/rails/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/rails/rails/downloads","issues_url":"https://api.github.com/repos/rails/rails/issues{/number}","pulls_url":"https://api.github.com/repos/rails/rails/pulls{/number}","milestones_url":"https://api.github.com/repos/rails/rails/milestones{/number}","notifications_url":"https://api.github.com/repos/rails/rails/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/rails/rails/labels{/name}","releases_url":"https://api.github.com/repos/rails/rails/releases{/id}","created_at":"2008-04-11T02:19:47Z","updated_at":"2015-09-20T08:16:40Z","pushed_at":"2015-09-20T07:35:53Z","git_url":"git://github.com/rails/rails.git","ssh_url":"git@github.com:rails/rails.git","clone_url":"https://github.com/rails/rails.git","svn_url":"https://github.com/rails/rails","homepage":"http://rubyonrails.org","size":458475,"stargazers_count":27759,"watchers_count":27759,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":11156,"mirror_url":null,"open_issues_count":914,"forks":11156,"open_issues":914,"watchers":27759,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/rails/rails/pulls/21688"},"html":{"href":"https://github.com/rails/rails/pull/21688"},"issue":{"href":"https://api.github.com/repos/rails/rails/issues/21688"},"comments":{"href":"https://api.github.com/repos/rails/rails/issues/21688/comments"},"review_comments":{"href":"https://api.github.com/repos/rails/rails/pulls/21688/comments"},"review_comment":{"href":"https://api.github.com/repos/rails/rails/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/rails/rails/pulls/21688/commits"},"statuses":{"href":"https://api.github.com/repos/rails/rails/statuses/e6be15bb8e028cb1b4e964f90a1bc4ad5e34871c"}}}}