{"action":"created","comment":{"url":"https://api.github.com/repos/redbooth/percona_migrator/pulls/comments/55656809","id":55656809,"diff_hunk":"@@ -142,6 +156,14 @@ def execute_and_free(sql, name = nil)\n       private\n \n       attr_reader :mysql_adapter, :logger, :runner, :cli_generator\n+\n+      # Checks whether the sql statement is an ALTER TABLE\n+      #\n+      # @param sql [String]\n+      # @return [Boolean]\n+      def alter_statement?(sql)\n+        sql =~ /alter table/i","path":"lib/active_record/connection_adapters/percona_adapter.rb","position":31,"original_position":31,"commit_id":"62ba2c73005f39815bfee718a942b34d4c9ec59c","original_commit_id":"62ba2c73005f39815bfee718a942b34d4c9ec59c","user":{"login":"andresgutgon","id":49499,"avatar_url":"https://avatars.githubusercontent.com/u/49499?v=3","gravatar_id":"","url":"https://api.github.com/users/andresgutgon","html_url":"https://github.com/andresgutgon","followers_url":"https://api.github.com/users/andresgutgon/followers","following_url":"https://api.github.com/users/andresgutgon/following{/other_user}","gists_url":"https://api.github.com/users/andresgutgon/gists{/gist_id}","starred_url":"https://api.github.com/users/andresgutgon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andresgutgon/subscriptions","organizations_url":"https://api.github.com/users/andresgutgon/orgs","repos_url":"https://api.github.com/users/andresgutgon/repos","events_url":"https://api.github.com/users/andresgutgon/events{/privacy}","received_events_url":"https://api.github.com/users/andresgutgon/received_events","type":"User","site_admin":false},"body":"got it","created_at":"2016-03-10T10:00:08Z","updated_at":"2016-03-10T10:00:08Z","html_url":"https://github.com/redbooth/percona_migrator/pull/19#discussion_r55656809","pull_request_url":"https://api.github.com/repos/redbooth/percona_migrator/pulls/19","_links":{"self":{"href":"https://api.github.com/repos/redbooth/percona_migrator/pulls/comments/55656809"},"html":{"href":"https://github.com/redbooth/percona_migrator/pull/19#discussion_r55656809"},"pull_request":{"href":"https://api.github.com/repos/redbooth/percona_migrator/pulls/19"}}},"pull_request":{"url":"https://api.github.com/repos/redbooth/percona_migrator/pulls/19","id":62261263,"html_url":"https://github.com/redbooth/percona_migrator/pull/19","diff_url":"https://github.com/redbooth/percona_migrator/pull/19.diff","patch_url":"https://github.com/redbooth/percona_migrator/pull/19.patch","issue_url":"https://api.github.com/repos/redbooth/percona_migrator/issues/19","number":19,"state":"open","locked":false,"title":"Support #execute including alter table statements","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":"This basically allows to call `#execute` from a migration. If you included an alter statement, it'll go through Percona, otherwise it'll go through the regular mysql adapter instead.","created_at":"2016-03-09T17:02:55Z","updated_at":"2016-03-10T10:00:08Z","closed_at":null,"merged_at":null,"merge_commit_sha":"74da64bcb25bb03d426a485ef6706b0539979f46","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/redbooth/percona_migrator/pulls/19/commits","review_comments_url":"https://api.github.com/repos/redbooth/percona_migrator/pulls/19/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/19/comments","statuses_url":"https://api.github.com/repos/redbooth/percona_migrator/statuses/62ba2c73005f39815bfee718a942b34d4c9ec59c","head":{"label":"redbooth:allow-execute-method","ref":"allow-execute-method","sha":"62ba2c73005f39815bfee718a942b34d4c9ec59c","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":"2016-03-09T11:42:32Z","pushed_at":"2016-03-09T18:39:07Z","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":124,"stargazers_count":3,"watchers_count":3,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":2,"forks":1,"open_issues":2,"watchers":3,"default_branch":"master"}},"base":{"label":"redbooth:master","ref":"master","sha":"c86038ac33d9046780c147cb16ce8e768b89b2bb","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":"2016-03-09T11:42:32Z","pushed_at":"2016-03-09T18:39:07Z","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":124,"stargazers_count":3,"watchers_count":3,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":2,"forks":1,"open_issues":2,"watchers":3,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/redbooth/percona_migrator/pulls/19"},"html":{"href":"https://github.com/redbooth/percona_migrator/pull/19"},"issue":{"href":"https://api.github.com/repos/redbooth/percona_migrator/issues/19"},"comments":{"href":"https://api.github.com/repos/redbooth/percona_migrator/issues/19/comments"},"review_comments":{"href":"https://api.github.com/repos/redbooth/percona_migrator/pulls/19/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/19/commits"},"statuses":{"href":"https://api.github.com/repos/redbooth/percona_migrator/statuses/62ba2c73005f39815bfee718a942b34d4c9ec59c"}}}}