{"action":"created","comment":{"url":"https://api.github.com/repos/redbooth/percona_migrator/pulls/comments/51536501","id":51536501,"diff_hunk":"@@ -1,53 +0,0 @@\n-module PerconaMigrator","path":"lib/percona_migrator/lhm_parser.rb","position":1,"original_position":1,"commit_id":"2e0c14f01301d886ed02a617b5ab550ec118850b","original_commit_id":"fe23d9a39f191d9771214c076f694d341e3840dc","user":{"login":"sauloperez","id":762088,"avatar_url":"https://avatars.githubusercontent.com/u/762088?v=3","gravatar_id":"","url":"https://api.github.com/users/sauloperez","html_url":"https://github.com/sauloperez","followers_url":"https://api.github.com/users/sauloperez/followers","following_url":"https://api.github.com/users/sauloperez/following{/other_user}","gists_url":"https://api.github.com/users/sauloperez/gists{/gist_id}","starred_url":"https://api.github.com/users/sauloperez/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sauloperez/subscriptions","organizations_url":"https://api.github.com/users/sauloperez/orgs","repos_url":"https://api.github.com/users/sauloperez/repos","events_url":"https://api.github.com/users/sauloperez/events{/privacy}","received_events_url":"https://api.github.com/users/sauloperez/received_events","type":"User","site_admin":false},"body":"I'll use it as an optional adapter that can specify in config. In case you have LHM migrations (like us) plug it in to parse LHM statements first to then handle it to the percona connection adapter. If not, proceed with the regular percona connection adapter.","created_at":"2016-02-02T08:16:29Z","updated_at":"2016-02-02T08:16:29Z","html_url":"https://github.com/redbooth/percona_migrator/pull/5#discussion_r51536501","pull_request_url":"https://api.github.com/repos/redbooth/percona_migrator/pulls/5","_links":{"self":{"href":"https://api.github.com/repos/redbooth/percona_migrator/pulls/comments/51536501"},"html":{"href":"https://github.com/redbooth/percona_migrator/pull/5#discussion_r51536501"},"pull_request":{"href":"https://api.github.com/repos/redbooth/percona_migrator/pulls/5"}}},"pull_request":{"url":"https://api.github.com/repos/redbooth/percona_migrator/pulls/5","id":54853840,"html_url":"https://github.com/redbooth/percona_migrator/pull/5","diff_url":"https://github.com/redbooth/percona_migrator/pull/5.diff","patch_url":"https://github.com/redbooth/percona_migrator/pull/5.patch","issue_url":"https://api.github.com/repos/redbooth/percona_migrator/issues/5","number":5,"state":"open","locked":false,"title":"Implement as connection adapter","user":{"login":"sauloperez","id":762088,"avatar_url":"https://avatars.githubusercontent.com/u/762088?v=3","gravatar_id":"","url":"https://api.github.com/users/sauloperez","html_url":"https://github.com/sauloperez","followers_url":"https://api.github.com/users/sauloperez/followers","following_url":"https://api.github.com/users/sauloperez/following{/other_user}","gists_url":"https://api.github.com/users/sauloperez/gists{/gist_id}","starred_url":"https://api.github.com/users/sauloperez/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sauloperez/subscriptions","organizations_url":"https://api.github.com/users/sauloperez/orgs","repos_url":"https://api.github.com/users/sauloperez/repos","events_url":"https://api.github.com/users/sauloperez/events{/privacy}","received_events_url":"https://api.github.com/users/sauloperez/received_events","type":"User","site_admin":false},"body":"I'm trying to figure out whether it's feasible to implement it as a regular ActiveRecord connection adapter that executes the queries through pt-online-schema-change. This seems more robust than parsing db statements and allows us to remove the LHM dependency :tada: \r\n\r\nIt works by recording the SQL statement that the abstract_mysql_adapter generates from DSL methods such as `add_column` and then executes it wrapping it within a `pt-online-schema-change` command.\r\n\r\nThe adapter needs to implement a number of extra methods that the abstract adapter requires. Note however, that these are all delegated to the mysql2_adapter, so our adapter depends on it, which seems reasonable to me.","created_at":"2015-12-31T08:47:56Z","updated_at":"2016-02-02T08:16:29Z","closed_at":null,"merged_at":null,"merge_commit_sha":"c9b904c101a77a2a6f661705645b24ea210a8eb6","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/redbooth/percona_migrator/pulls/5/commits","review_comments_url":"https://api.github.com/repos/redbooth/percona_migrator/pulls/5/comments","review_comment_url":"https://api.github.com/repos/redbooth/percona_migrator/pulls/comments{/number}","comments_url":"https://api.github.com/repos/redbooth/percona_migrator/issues/5/comments","statuses_url":"https://api.github.com/repos/redbooth/percona_migrator/statuses/2e0c14f01301d886ed02a617b5ab550ec118850b","head":{"label":"redbooth:implement-as-connection-adapter","ref":"implement-as-connection-adapter","sha":"2e0c14f01301d886ed02a617b5ab550ec118850b","user":{"login":"redbooth","id":7304334,"avatar_url":"https://avatars.githubusercontent.com/u/7304334?v=3","gravatar_id":"","url":"https://api.github.com/users/redbooth","html_url":"https://github.com/redbooth","followers_url":"https://api.github.com/users/redbooth/followers","following_url":"https://api.github.com/users/redbooth/following{/other_user}","gists_url":"https://api.github.com/users/redbooth/gists{/gist_id}","starred_url":"https://api.github.com/users/redbooth/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/redbooth/subscriptions","organizations_url":"https://api.github.com/users/redbooth/orgs","repos_url":"https://api.github.com/users/redbooth/repos","events_url":"https://api.github.com/users/redbooth/events{/privacy}","received_events_url":"https://api.github.com/users/redbooth/received_events","type":"Organization","site_admin":false},"repo":{"id":47969607,"name":"percona_migrator","full_name":"redbooth/percona_migrator","owner":{"login":"redbooth","id":7304334,"avatar_url":"https://avatars.githubusercontent.com/u/7304334?v=3","gravatar_id":"","url":"https://api.github.com/users/redbooth","html_url":"https://github.com/redbooth","followers_url":"https://api.github.com/users/redbooth/followers","following_url":"https://api.github.com/users/redbooth/following{/other_user}","gists_url":"https://api.github.com/users/redbooth/gists{/gist_id}","starred_url":"https://api.github.com/users/redbooth/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/redbooth/subscriptions","organizations_url":"https://api.github.com/users/redbooth/orgs","repos_url":"https://api.github.com/users/redbooth/repos","events_url":"https://api.github.com/users/redbooth/events{/privacy}","received_events_url":"https://api.github.com/users/redbooth/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/redbooth/percona_migrator","description":"Percona's pt-online-schema-change runner for ActiveRecord migrations","fork":false,"url":"https://api.github.com/repos/redbooth/percona_migrator","forks_url":"https://api.github.com/repos/redbooth/percona_migrator/forks","keys_url":"https://api.github.com/repos/redbooth/percona_migrator/keys{/key_id}","collaborators_url":"https://api.github.com/repos/redbooth/percona_migrator/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/redbooth/percona_migrator/teams","hooks_url":"https://api.github.com/repos/redbooth/percona_migrator/hooks","issue_events_url":"https://api.github.com/repos/redbooth/percona_migrator/issues/events{/number}","events_url":"https://api.github.com/repos/redbooth/percona_migrator/events","assignees_url":"https://api.github.com/repos/redbooth/percona_migrator/assignees{/user}","branches_url":"https://api.github.com/repos/redbooth/percona_migrator/branches{/branch}","tags_url":"https://api.github.com/repos/redbooth/percona_migrator/tags","blobs_url":"https://api.github.com/repos/redbooth/percona_migrator/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/redbooth/percona_migrator/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/redbooth/percona_migrator/git/refs{/sha}","trees_url":"https://api.github.com/repos/redbooth/percona_migrator/git/trees{/sha}","statuses_url":"https://api.github.com/repos/redbooth/percona_migrator/statuses/{sha}","languages_url":"https://api.github.com/repos/redbooth/percona_migrator/languages","stargazers_url":"https://api.github.com/repos/redbooth/percona_migrator/stargazers","contributors_url":"https://api.github.com/repos/redbooth/percona_migrator/contributors","subscribers_url":"https://api.github.com/repos/redbooth/percona_migrator/subscribers","subscription_url":"https://api.github.com/repos/redbooth/percona_migrator/subscription","commits_url":"https://api.github.com/repos/redbooth/percona_migrator/commits{/sha}","git_commits_url":"https://api.github.com/repos/redbooth/percona_migrator/git/commits{/sha}","comments_url":"https://api.github.com/repos/redbooth/percona_migrator/comments{/number}","issue_comment_url":"https://api.github.com/repos/redbooth/percona_migrator/issues/comments{/number}","contents_url":"https://api.github.com/repos/redbooth/percona_migrator/contents/{+path}","compare_url":"https://api.github.com/repos/redbooth/percona_migrator/compare/{base}...{head}","merges_url":"https://api.github.com/repos/redbooth/percona_migrator/merges","archive_url":"https://api.github.com/repos/redbooth/percona_migrator/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/redbooth/percona_migrator/downloads","issues_url":"https://api.github.com/repos/redbooth/percona_migrator/issues{/number}","pulls_url":"https://api.github.com/repos/redbooth/percona_migrator/pulls{/number}","milestones_url":"https://api.github.com/repos/redbooth/percona_migrator/milestones{/number}","notifications_url":"https://api.github.com/repos/redbooth/percona_migrator/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/redbooth/percona_migrator/labels{/name}","releases_url":"https://api.github.com/repos/redbooth/percona_migrator/releases{/id}","deployments_url":"https://api.github.com/repos/redbooth/percona_migrator/deployments","created_at":"2015-12-14T11:00:12Z","updated_at":"2015-12-18T14:22:32Z","pushed_at":"2016-02-02T08:14:19Z","git_url":"git://github.com/redbooth/percona_migrator.git","ssh_url":"git@github.com:redbooth/percona_migrator.git","clone_url":"https://github.com/redbooth/percona_migrator.git","svn_url":"https://github.com/redbooth/percona_migrator","homepage":"","size":44,"stargazers_count":1,"watchers_count":1,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2,"mirror_url":null,"open_issues_count":1,"forks":2,"open_issues":1,"watchers":1,"default_branch":"master"}},"base":{"label":"redbooth:master","ref":"master","sha":"0ea97d4fdb64d75baa2c6cfe63d56bf631b3c93c","user":{"login":"redbooth","id":7304334,"avatar_url":"https://avatars.githubusercontent.com/u/7304334?v=3","gravatar_id":"","url":"https://api.github.com/users/redbooth","html_url":"https://github.com/redbooth","followers_url":"https://api.github.com/users/redbooth/followers","following_url":"https://api.github.com/users/redbooth/following{/other_user}","gists_url":"https://api.github.com/users/redbooth/gists{/gist_id}","starred_url":"https://api.github.com/users/redbooth/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/redbooth/subscriptions","organizations_url":"https://api.github.com/users/redbooth/orgs","repos_url":"https://api.github.com/users/redbooth/repos","events_url":"https://api.github.com/users/redbooth/events{/privacy}","received_events_url":"https://api.github.com/users/redbooth/received_events","type":"Organization","site_admin":false},"repo":{"id":47969607,"name":"percona_migrator","full_name":"redbooth/percona_migrator","owner":{"login":"redbooth","id":7304334,"avatar_url":"https://avatars.githubusercontent.com/u/7304334?v=3","gravatar_id":"","url":"https://api.github.com/users/redbooth","html_url":"https://github.com/redbooth","followers_url":"https://api.github.com/users/redbooth/followers","following_url":"https://api.github.com/users/redbooth/following{/other_user}","gists_url":"https://api.github.com/users/redbooth/gists{/gist_id}","starred_url":"https://api.github.com/users/redbooth/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/redbooth/subscriptions","organizations_url":"https://api.github.com/users/redbooth/orgs","repos_url":"https://api.github.com/users/redbooth/repos","events_url":"https://api.github.com/users/redbooth/events{/privacy}","received_events_url":"https://api.github.com/users/redbooth/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/redbooth/percona_migrator","description":"Percona's pt-online-schema-change runner for ActiveRecord migrations","fork":false,"url":"https://api.github.com/repos/redbooth/percona_migrator","forks_url":"https://api.github.com/repos/redbooth/percona_migrator/forks","keys_url":"https://api.github.com/repos/redbooth/percona_migrator/keys{/key_id}","collaborators_url":"https://api.github.com/repos/redbooth/percona_migrator/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/redbooth/percona_migrator/teams","hooks_url":"https://api.github.com/repos/redbooth/percona_migrator/hooks","issue_events_url":"https://api.github.com/repos/redbooth/percona_migrator/issues/events{/number}","events_url":"https://api.github.com/repos/redbooth/percona_migrator/events","assignees_url":"https://api.github.com/repos/redbooth/percona_migrator/assignees{/user}","branches_url":"https://api.github.com/repos/redbooth/percona_migrator/branches{/branch}","tags_url":"https://api.github.com/repos/redbooth/percona_migrator/tags","blobs_url":"https://api.github.com/repos/redbooth/percona_migrator/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/redbooth/percona_migrator/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/redbooth/percona_migrator/git/refs{/sha}","trees_url":"https://api.github.com/repos/redbooth/percona_migrator/git/trees{/sha}","statuses_url":"https://api.github.com/repos/redbooth/percona_migrator/statuses/{sha}","languages_url":"https://api.github.com/repos/redbooth/percona_migrator/languages","stargazers_url":"https://api.github.com/repos/redbooth/percona_migrator/stargazers","contributors_url":"https://api.github.com/repos/redbooth/percona_migrator/contributors","subscribers_url":"https://api.github.com/repos/redbooth/percona_migrator/subscribers","subscription_url":"https://api.github.com/repos/redbooth/percona_migrator/subscription","commits_url":"https://api.github.com/repos/redbooth/percona_migrator/commits{/sha}","git_commits_url":"https://api.github.com/repos/redbooth/percona_migrator/git/commits{/sha}","comments_url":"https://api.github.com/repos/redbooth/percona_migrator/comments{/number}","issue_comment_url":"https://api.github.com/repos/redbooth/percona_migrator/issues/comments{/number}","contents_url":"https://api.github.com/repos/redbooth/percona_migrator/contents/{+path}","compare_url":"https://api.github.com/repos/redbooth/percona_migrator/compare/{base}...{head}","merges_url":"https://api.github.com/repos/redbooth/percona_migrator/merges","archive_url":"https://api.github.com/repos/redbooth/percona_migrator/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/redbooth/percona_migrator/downloads","issues_url":"https://api.github.com/repos/redbooth/percona_migrator/issues{/number}","pulls_url":"https://api.github.com/repos/redbooth/percona_migrator/pulls{/number}","milestones_url":"https://api.github.com/repos/redbooth/percona_migrator/milestones{/number}","notifications_url":"https://api.github.com/repos/redbooth/percona_migrator/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/redbooth/percona_migrator/labels{/name}","releases_url":"https://api.github.com/repos/redbooth/percona_migrator/releases{/id}","deployments_url":"https://api.github.com/repos/redbooth/percona_migrator/deployments","created_at":"2015-12-14T11:00:12Z","updated_at":"2015-12-18T14:22:32Z","pushed_at":"2016-02-02T08:14:19Z","git_url":"git://github.com/redbooth/percona_migrator.git","ssh_url":"git@github.com:redbooth/percona_migrator.git","clone_url":"https://github.com/redbooth/percona_migrator.git","svn_url":"https://github.com/redbooth/percona_migrator","homepage":"","size":44,"stargazers_count":1,"watchers_count":1,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2,"mirror_url":null,"open_issues_count":1,"forks":2,"open_issues":1,"watchers":1,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/redbooth/percona_migrator/pulls/5"},"html":{"href":"https://github.com/redbooth/percona_migrator/pull/5"},"issue":{"href":"https://api.github.com/repos/redbooth/percona_migrator/issues/5"},"comments":{"href":"https://api.github.com/repos/redbooth/percona_migrator/issues/5/comments"},"review_comments":{"href":"https://api.github.com/repos/redbooth/percona_migrator/pulls/5/comments"},"review_comment":{"href":"https://api.github.com/repos/redbooth/percona_migrator/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/redbooth/percona_migrator/pulls/5/commits"},"statuses":{"href":"https://api.github.com/repos/redbooth/percona_migrator/statuses/2e0c14f01301d886ed02a617b5ab550ec118850b"}}}}