I have two (InnoDB) tables with triggers for UPDATE, INSERT and DELETE. They work fine if I work directly on the tables. Further I have a foreign key constraint when I delete a row in tableA all rows in tableB referenced by tableA.id get also deleted. That also works but the problem is:
A DELETE on tableA triggers the DELETE-trigger for tableA. Then the constraint deletes rows at tableB but no DELETE-triggers for tableB get called. Why? Do constraints do not trigger triggers?
Thanks.
(Triggers are AFTER DELETE. Tried also with BEFORE DELETE without success.)
Triggers aren't fired if the delete is caused by a foreign key.
From the manual
Triggers currently are not activated by foreign key actions.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With