Comment 3 for bug 1093911

Revision history for this message
yvonne (mysql-girl) wrote :

YES - it worked

adding --set-vars="foreign_key_checks=0"
took care of it
thx

 pt-online-schema-change -uxxxxxxxx -pxxxxx h=127.0.0.1,D=sku,t=subscription_elements -P3306 --alter "ADD COLUMN country_id TINYINT(3) UNSIGNED default 228 NOT NULL, ADD COLUMN language_id TINYINT(3) UNSIGNED default 44 NOT NULL, ADD CONSTRAINT fk_se_country_1 FOREIGN KEY (country_id) REFERENCES country(country_id) ON DELETE NO ACTION ON UPDATE NO ACTION, ADD CONSTRAINT fk_se_language_1 FOREIGN KEY (language_id) REFERENCES language(language_id) ON DELETE NO ACTION ON UPDATE NO ACTION" --alter-foreign-keys-method=auto --execute --set-vars="foreign_key_checks=0"
No foreign keys reference `sku`.`subscription_elements`; ignoring --alter-foreign-keys-method.
Altering `sku`.`subscription_elements`...
Creating new table...
Created new table sku._subscription_elements_new OK.
Altering new table...
Altered `sku`.`_subscription_elements_new` OK.
Creating triggers...
Created triggers OK.
Copying approximately 1803540 rows...
Copying `sku`.`subscription_elements`: 16% 02:30 remain
Copying `sku`.`subscription_elements`: 28% 02:26 remain
Copying `sku`.`subscription_elements`: 39% 02:15 remain
Copying `sku`.`subscription_elements`: 50% 01:59 remain
Copying `sku`.`subscription_elements`: 64% 01:23 remain
Copying `sku`.`subscription_elements`: 75% 00:59 remain
Copying `sku`.`subscription_elements`: 87% 00:29 remain
Copied rows OK.
Swapping tables...
Swapped original and new tables OK.
Dropping old table...
Dropped old table `sku`.`_subscription_elements_old` OK.
Dropping triggers...
Dropped triggers OK.
Successfully altered `sku`.`subscription_elements`.