I thought foreign key wont matter for me but now i think i have to adopt. i have over 20 tables with many to many relationships which serves a blog website.
table: gateway (post_id, group_id, post_type, post_date ...)
table: post (post_id, group_id, title, body ...)
table: poll (post_id, group_id, title, ...)
and like wise table: video, photo, link tables; and then they have table: to track like/unlike records and user comment records -- which all shares a common field post_id var(14)
at this point i think it would be better to reference them with foreign keys. in this example i have 8 tables which can be linked with post_id, so i tried FK between post & gateway [on delete: cascade, on update: no action(InnoDB)] now when i try other table to ref. FK to gateway or post it throws an error and i dont know why? definitely i am wrong somewhere.
Kindly help me if my approach is right or is there a better way?
This is the error message I get: