Skip to content

Added a pt-osc plugin to rename a FK to its original name #53

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

elchinoo
Copy link
Contributor

Added a pt-osc plugin to rename a FK to its original name removing the trailing '_'

@elchinoo
Copy link
Contributor Author

Example adding a new column:

pt-online-schema-change --set-vars=foreign_key_checks=0 \ --plugin=/PATH/TO/ptosc_plugin_rename_fk.pl \ --execute \ --alter="add column MY_NEW_COLUMN varchar(200) not null default ''" \ -h <DB_HOST> -P <DB_PORT> -u <USER> -p <PASSWORD> \ D=<my_db>,t=<my_table>

Can alternatively use --defaults-file option to suppress the username/password from the console

DBjunkies and others added 5 commits April 17, 2019 16:33
…was present in the new table and was trying to remove it from the table throwing an error.

Added a new check when using '--alter-foreign-keys-method=drop_swap'. When using the drop_swap method the tool set 'drop-old-table' to false and the method 'after_drop_old_table' is not called.
Added a simple test suit which is far from complete or ideal but helps with repetitive tasks. This is intended to be replace in the future for a real test suit
Fixed issues when removing FK and other fixes
Cleanup. Removed unused tes functions
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