KEMBAR78
Support a complete ALTER TABLE statement in --alter by shlomi-noach · Pull Request #865 · github/gh-ost · GitHub
Skip to content

Conversation

@shlomi-noach
Copy link
Contributor

@shlomi-noach shlomi-noach commented Jul 22, 2020

This PR supports a complete ALTER TABLE statement in --alter command line argument.

Until this PR, if one wanted to run a ALTER TABLE my_schema.my_table DROP COLUMN b, one would have to run gh-ost with:

  • --database=my_schema
  • --table=my_table
  • --alter="DROP COLUMN b"

Starting this PR, gh-ost can deduce schema and table names from the --alter statement. It's now valid to:

  • --ALTER="ALTER TABLE my_schema.my_table DROP COLUMN b"

as well as:

  • --database=my_schema --ALTER="ALTER TABLE my_table DROP COLUMN b"

@shlomi-noach
Copy link
Contributor Author

shlomi-noach commented Jul 22, 2020

I did intend to first open this PR against https://github.com/openark/gh-ost ; but hit the wrong button... Since we're already here, I'm also happy to submit it upstream.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants