{"action":"closed","number":12,"pull_request":{"url":"https://api.github.com/repos/Shopify/lhm/pulls/12","id":52574428,"html_url":"https://github.com/Shopify/lhm/pull/12","diff_url":"https://github.com/Shopify/lhm/pull/12.diff","patch_url":"https://github.com/Shopify/lhm/pull/12.patch","issue_url":"https://api.github.com/repos/Shopify/lhm/issues/12","number":12,"state":"closed","locked":false,"title":"Create emoji friendly tables by default","user":{"login":"jordanwheeler","id":2702398,"avatar_url":"https://avatars.githubusercontent.com/u/2702398?v=3","gravatar_id":"","url":"https://api.github.com/users/jordanwheeler","html_url":"https://github.com/jordanwheeler","followers_url":"https://api.github.com/users/jordanwheeler/followers","following_url":"https://api.github.com/users/jordanwheeler/following{/other_user}","gists_url":"https://api.github.com/users/jordanwheeler/gists{/gist_id}","starred_url":"https://api.github.com/users/jordanwheeler/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jordanwheeler/subscriptions","organizations_url":"https://api.github.com/users/jordanwheeler/orgs","repos_url":"https://api.github.com/users/jordanwheeler/repos","events_url":"https://api.github.com/users/jordanwheeler/events{/privacy}","received_events_url":"https://api.github.com/users/jordanwheeler/received_events","type":"User","site_admin":false},"body":"This will patch LHM to create all tables with `DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC` by default.  As long as a table has an LHM run on it at some point, it'll now be emoji friendly without us having to manually update it.\r\n\r\nThe code is pretty simple.  Normally when creating the new table, LHM takes the existing table's attributes and simply swaps its name with `lhmn_#{name}`.  This adds a regex that'll also swap the `DEFAULT CHARSET=x` with `DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC`  \r\n\r\nGetting the integration tests passing was a bit of a nightmare, but I've finally got everything passing locally. \r\n\r\nProof (from the integration tests):\r\n\r\n```\r\nCREATE TABLE `lhmn_users` (\r\n  `id` int(11) NOT NULL AUTO_INCREMENT,\r\n  `reference` int(11) DEFAULT NULL,\r\n  `username` varchar(255) DEFAULT NULL,\r\n  `group` varchar(255) DEFAULT 'Superfriends',\r\n  `created_at` datetime DEFAULT NULL,\r\n  `comment` varchar(20) DEFAULT NULL,\r\n  `description` text,\r\n  PRIMARY KEY (`id`),\r\n  UNIQUE KEY `index_users_on_reference` (`reference`),\r\n  KEY `index_users_on_username_and_created_at` (`username`,`created_at`),\r\n  KEY `index_with_a_custom_name` (`username`,`group`)\r\n) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC /* large hadron migration */\r\n```\r\n@SingerWang @jasonhl ","created_at":"2015-12-03T18:43:13Z","updated_at":"2015-12-04T17:23:57Z","closed_at":"2015-12-04T17:23:57Z","merged_at":"2015-12-04T17:23:57Z","merge_commit_sha":"16d7d035aeb3472308bf3dc713babbf044ed7ab5","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/Shopify/lhm/pulls/12/commits","review_comments_url":"https://api.github.com/repos/Shopify/lhm/pulls/12/comments","review_comment_url":"https://api.github.com/repos/Shopify/lhm/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Shopify/lhm/issues/12/comments","statuses_url":"https://api.github.com/repos/Shopify/lhm/statuses/03f7eb112fd457001247d08573dd5ef84ceec2bc","head":{"label":"Shopify:emoji-table-creation","ref":"emoji-table-creation","sha":"03f7eb112fd457001247d08573dd5ef84ceec2bc","user":{"login":"Shopify","id":8085,"avatar_url":"https://avatars.githubusercontent.com/u/8085?v=3","gravatar_id":"","url":"https://api.github.com/users/Shopify","html_url":"https://github.com/Shopify","followers_url":"https://api.github.com/users/Shopify/followers","following_url":"https://api.github.com/users/Shopify/following{/other_user}","gists_url":"https://api.github.com/users/Shopify/gists{/gist_id}","starred_url":"https://api.github.com/users/Shopify/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Shopify/subscriptions","organizations_url":"https://api.github.com/users/Shopify/orgs","repos_url":"https://api.github.com/users/Shopify/repos","events_url":"https://api.github.com/users/Shopify/events{/privacy}","received_events_url":"https://api.github.com/users/Shopify/received_events","type":"Organization","site_admin":false},"repo":{"id":15902229,"name":"lhm","full_name":"Shopify/lhm","owner":{"login":"Shopify","id":8085,"avatar_url":"https://avatars.githubusercontent.com/u/8085?v=3","gravatar_id":"","url":"https://api.github.com/users/Shopify","html_url":"https://github.com/Shopify","followers_url":"https://api.github.com/users/Shopify/followers","following_url":"https://api.github.com/users/Shopify/following{/other_user}","gists_url":"https://api.github.com/users/Shopify/gists{/gist_id}","starred_url":"https://api.github.com/users/Shopify/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Shopify/subscriptions","organizations_url":"https://api.github.com/users/Shopify/orgs","repos_url":"https://api.github.com/users/Shopify/repos","events_url":"https://api.github.com/users/Shopify/events{/privacy}","received_events_url":"https://api.github.com/users/Shopify/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Shopify/lhm","description":"Online MySQL schema migrations","fork":true,"url":"https://api.github.com/repos/Shopify/lhm","forks_url":"https://api.github.com/repos/Shopify/lhm/forks","keys_url":"https://api.github.com/repos/Shopify/lhm/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Shopify/lhm/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Shopify/lhm/teams","hooks_url":"https://api.github.com/repos/Shopify/lhm/hooks","issue_events_url":"https://api.github.com/repos/Shopify/lhm/issues/events{/number}","events_url":"https://api.github.com/repos/Shopify/lhm/events","assignees_url":"https://api.github.com/repos/Shopify/lhm/assignees{/user}","branches_url":"https://api.github.com/repos/Shopify/lhm/branches{/branch}","tags_url":"https://api.github.com/repos/Shopify/lhm/tags","blobs_url":"https://api.github.com/repos/Shopify/lhm/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Shopify/lhm/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Shopify/lhm/git/refs{/sha}","trees_url":"https://api.github.com/repos/Shopify/lhm/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Shopify/lhm/statuses/{sha}","languages_url":"https://api.github.com/repos/Shopify/lhm/languages","stargazers_url":"https://api.github.com/repos/Shopify/lhm/stargazers","contributors_url":"https://api.github.com/repos/Shopify/lhm/contributors","subscribers_url":"https://api.github.com/repos/Shopify/lhm/subscribers","subscription_url":"https://api.github.com/repos/Shopify/lhm/subscription","commits_url":"https://api.github.com/repos/Shopify/lhm/commits{/sha}","git_commits_url":"https://api.github.com/repos/Shopify/lhm/git/commits{/sha}","comments_url":"https://api.github.com/repos/Shopify/lhm/comments{/number}","issue_comment_url":"https://api.github.com/repos/Shopify/lhm/issues/comments{/number}","contents_url":"https://api.github.com/repos/Shopify/lhm/contents/{+path}","compare_url":"https://api.github.com/repos/Shopify/lhm/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Shopify/lhm/merges","archive_url":"https://api.github.com/repos/Shopify/lhm/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Shopify/lhm/downloads","issues_url":"https://api.github.com/repos/Shopify/lhm/issues{/number}","pulls_url":"https://api.github.com/repos/Shopify/lhm/pulls{/number}","milestones_url":"https://api.github.com/repos/Shopify/lhm/milestones{/number}","notifications_url":"https://api.github.com/repos/Shopify/lhm/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Shopify/lhm/labels{/name}","releases_url":"https://api.github.com/repos/Shopify/lhm/releases{/id}","created_at":"2014-01-14T13:08:57Z","updated_at":"2015-11-04T20:00:24Z","pushed_at":"2015-12-04T17:23:57Z","git_url":"git://github.com/Shopify/lhm.git","ssh_url":"git@github.com:Shopify/lhm.git","clone_url":"https://github.com/Shopify/lhm.git","svn_url":"https://github.com/Shopify/lhm","homepage":"","size":561,"stargazers_count":5,"watchers_count":5,"language":"Ruby","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":2,"mirror_url":null,"open_issues_count":4,"forks":2,"open_issues":4,"watchers":5,"default_branch":"master"}},"base":{"label":"Shopify:master","ref":"master","sha":"7d30899a87b6c15e6d4fffc0278ec939c36dd72a","user":{"login":"Shopify","id":8085,"avatar_url":"https://avatars.githubusercontent.com/u/8085?v=3","gravatar_id":"","url":"https://api.github.com/users/Shopify","html_url":"https://github.com/Shopify","followers_url":"https://api.github.com/users/Shopify/followers","following_url":"https://api.github.com/users/Shopify/following{/other_user}","gists_url":"https://api.github.com/users/Shopify/gists{/gist_id}","starred_url":"https://api.github.com/users/Shopify/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Shopify/subscriptions","organizations_url":"https://api.github.com/users/Shopify/orgs","repos_url":"https://api.github.com/users/Shopify/repos","events_url":"https://api.github.com/users/Shopify/events{/privacy}","received_events_url":"https://api.github.com/users/Shopify/received_events","type":"Organization","site_admin":false},"repo":{"id":15902229,"name":"lhm","full_name":"Shopify/lhm","owner":{"login":"Shopify","id":8085,"avatar_url":"https://avatars.githubusercontent.com/u/8085?v=3","gravatar_id":"","url":"https://api.github.com/users/Shopify","html_url":"https://github.com/Shopify","followers_url":"https://api.github.com/users/Shopify/followers","following_url":"https://api.github.com/users/Shopify/following{/other_user}","gists_url":"https://api.github.com/users/Shopify/gists{/gist_id}","starred_url":"https://api.github.com/users/Shopify/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Shopify/subscriptions","organizations_url":"https://api.github.com/users/Shopify/orgs","repos_url":"https://api.github.com/users/Shopify/repos","events_url":"https://api.github.com/users/Shopify/events{/privacy}","received_events_url":"https://api.github.com/users/Shopify/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Shopify/lhm","description":"Online MySQL schema migrations","fork":true,"url":"https://api.github.com/repos/Shopify/lhm","forks_url":"https://api.github.com/repos/Shopify/lhm/forks","keys_url":"https://api.github.com/repos/Shopify/lhm/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Shopify/lhm/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Shopify/lhm/teams","hooks_url":"https://api.github.com/repos/Shopify/lhm/hooks","issue_events_url":"https://api.github.com/repos/Shopify/lhm/issues/events{/number}","events_url":"https://api.github.com/repos/Shopify/lhm/events","assignees_url":"https://api.github.com/repos/Shopify/lhm/assignees{/user}","branches_url":"https://api.github.com/repos/Shopify/lhm/branches{/branch}","tags_url":"https://api.github.com/repos/Shopify/lhm/tags","blobs_url":"https://api.github.com/repos/Shopify/lhm/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Shopify/lhm/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Shopify/lhm/git/refs{/sha}","trees_url":"https://api.github.com/repos/Shopify/lhm/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Shopify/lhm/statuses/{sha}","languages_url":"https://api.github.com/repos/Shopify/lhm/languages","stargazers_url":"https://api.github.com/repos/Shopify/lhm/stargazers","contributors_url":"https://api.github.com/repos/Shopify/lhm/contributors","subscribers_url":"https://api.github.com/repos/Shopify/lhm/subscribers","subscription_url":"https://api.github.com/repos/Shopify/lhm/subscription","commits_url":"https://api.github.com/repos/Shopify/lhm/commits{/sha}","git_commits_url":"https://api.github.com/repos/Shopify/lhm/git/commits{/sha}","comments_url":"https://api.github.com/repos/Shopify/lhm/comments{/number}","issue_comment_url":"https://api.github.com/repos/Shopify/lhm/issues/comments{/number}","contents_url":"https://api.github.com/repos/Shopify/lhm/contents/{+path}","compare_url":"https://api.github.com/repos/Shopify/lhm/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Shopify/lhm/merges","archive_url":"https://api.github.com/repos/Shopify/lhm/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Shopify/lhm/downloads","issues_url":"https://api.github.com/repos/Shopify/lhm/issues{/number}","pulls_url":"https://api.github.com/repos/Shopify/lhm/pulls{/number}","milestones_url":"https://api.github.com/repos/Shopify/lhm/milestones{/number}","notifications_url":"https://api.github.com/repos/Shopify/lhm/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Shopify/lhm/labels{/name}","releases_url":"https://api.github.com/repos/Shopify/lhm/releases{/id}","created_at":"2014-01-14T13:08:57Z","updated_at":"2015-11-04T20:00:24Z","pushed_at":"2015-12-04T17:23:57Z","git_url":"git://github.com/Shopify/lhm.git","ssh_url":"git@github.com:Shopify/lhm.git","clone_url":"https://github.com/Shopify/lhm.git","svn_url":"https://github.com/Shopify/lhm","homepage":"","size":561,"stargazers_count":5,"watchers_count":5,"language":"Ruby","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":2,"mirror_url":null,"open_issues_count":4,"forks":2,"open_issues":4,"watchers":5,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Shopify/lhm/pulls/12"},"html":{"href":"https://github.com/Shopify/lhm/pull/12"},"issue":{"href":"https://api.github.com/repos/Shopify/lhm/issues/12"},"comments":{"href":"https://api.github.com/repos/Shopify/lhm/issues/12/comments"},"review_comments":{"href":"https://api.github.com/repos/Shopify/lhm/pulls/12/comments"},"review_comment":{"href":"https://api.github.com/repos/Shopify/lhm/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Shopify/lhm/pulls/12/commits"},"statuses":{"href":"https://api.github.com/repos/Shopify/lhm/statuses/03f7eb112fd457001247d08573dd5ef84ceec2bc"}},"merged":true,"mergeable":null,"mergeable_state":"unknown","merged_by":{"login":"jordanwheeler","id":2702398,"avatar_url":"https://avatars.githubusercontent.com/u/2702398?v=3","gravatar_id":"","url":"https://api.github.com/users/jordanwheeler","html_url":"https://github.com/jordanwheeler","followers_url":"https://api.github.com/users/jordanwheeler/followers","following_url":"https://api.github.com/users/jordanwheeler/following{/other_user}","gists_url":"https://api.github.com/users/jordanwheeler/gists{/gist_id}","starred_url":"https://api.github.com/users/jordanwheeler/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jordanwheeler/subscriptions","organizations_url":"https://api.github.com/users/jordanwheeler/orgs","repos_url":"https://api.github.com/users/jordanwheeler/repos","events_url":"https://api.github.com/users/jordanwheeler/events{/privacy}","received_events_url":"https://api.github.com/users/jordanwheeler/received_events","type":"User","site_admin":false},"comments":7,"review_comments":5,"commits":2,"additions":59,"deletions":5,"changed_files":7}}