You probably have specified on delete cascade
. So this behavior. You do have a foreign key relationship
between the two mentioned tables.
According to the MySQL Foreign Key Constraints reference
CASCADE: Delete or update the row from the parent table, and
automatically delete or update the matching rows in the child table.
Both ON DELETE CASCADE and ON UPDATE CASCADE are supported.
As per MySQL document here http://dev.mysql.com/doc/refman/5.5/en/example-foreign-keys.html
For storage engines other than InnoDB, it is possible when defining a
column to use a REFERENCES tbl_name(col_name) clause, which has no
actual effect, and serves only as a memo or comment to you that the
column which you are currently defining is intended to refer to a
column in another table.
So since both the tables persist with FK
relationship; deleting a row from parent will also delete the matching row from child/referring table.
BASED ON YOUR COMMENT:
It is possible to create composite foreign key like below but for better performance try to decompose your table.
FOREIGN KEY (hook_id, hook_type)
REFERENCES article(article_id)