From a657f5bc3ac5e960af4f07945b12e709dfc9f5e4 Mon Sep 17 00:00:00 2001 From: Daniel Nichter Date: Mon, 13 Aug 2012 15:19:57 -0600 Subject: [PATCH] Document DROP FOREIGN KEY constraint_name limitation. --- bin/pt-online-schema-change | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/bin/pt-online-schema-change b/bin/pt-online-schema-change index bc5066a4..b9be9320 100755 --- a/bin/pt-online-schema-change +++ b/bin/pt-online-schema-change @@ -7991,6 +7991,17 @@ If you add a column without a default value and make it NOT NULL, the tool will fail, as it will not try to guess a default value for you; You must specify the default. +=item * + +C requires specifying C<_constraint_name> +rather than the real C. Due to a limitation in MySQL, +pt-online-schema-change adds a leading underscore to foreign key constraint +names when creating the new table. For example, to drop this contraint: + + CONSTRAINT `fk_foo` FOREIGN KEY (`foo_id`) REFERENCES `bar` (`foo_id`) + +You must specify C<--alter "DROP FOREIGN KEY _fk_foo">. + =back =item --alter-foreign-keys-method