1

I'm trying to save a catalog price rule and getting the following SQL error:

SQLSTATE[23000]: Integrity constraint violation: 1452 Cannot add or update a child row: a foreign key constraint fails (MY_DB_NAME.catalogrule_group_website, CONSTRAINT catalogrule_group_website_ibfk_1 FOREIGN KEY (rule_id) REFERENCES catalogrule (rule_id) ON DELETE CASCADE ON UPDATE CASCADE)

I was getting this error last night when I was trying to apply a different rule, but it went away and the rule was applied after I reindexed (which may or may not be related).

I tried reindexing a few times today too, no dice. I consistently get this error when I try to apply any rule(s).

I'm not completely SQL ignorant, but am having trouble even beginning to debug. Can anyone point me in the right direction?

On version 1.6.1

1 Answer 1

1

A foreign key constraint is there to help with data integrity. They normally fail if you are trying to update one table but do not update a linked table. If you look at the foreign key constraint it will tell you what the linked table is and what value it expects...

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.