Guys, help me figure it out on my fingers. (simplified the situation to the point)
There are two tables. The first with the list of goods. Let's call it productTable in it there is a column productID and the rest. There is a second table with commentTable comments and of course also with the poductID2 column (so as not to be confused). Now you need to establish links tables. I suppose to put on-update: cascade and on-delete: cascade Further small confusion, this is the essence of the issue.
In which table should this relationship be established?
I go to the productTable and put the link productID => poductID2 or vice versa in commentTable and link poductID2 => productID ?