I am having two tables pages(id,name)
and posts(id,msg)
In both pages
and posts
having id
field which is auto incremented and starts from 1
I want to create like table when a user likes a post
or page
details should be stored in like table.
My question is should i use different like table for post
and pages
1) page_like(page_id,user_id);// (page_id,user_id) composite PK
2) post_like(post_id,user_id);//(post_id,user_id) composite PK
or should i use
like(element_id,element_type,liked_by) //(element_id,element_type,liked_by) composite PK
Which method should i use and why ? Is there better way to do this?