support-snippets icon indicating copy to clipboard operation
support-snippets copied to clipboard

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

Open elchinoo opened this issue 6 years ago • 1 comments

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

elchinoo avatar Apr 10 '19 04:04 elchinoo

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

elchinoo avatar Apr 10 '19 04:04 elchinoo