Actually i m creating a kind of social network for learning, where user can share photo and links, i m using mysql as datastore, both types of post(later i can add more types as well ex- videos etc) can be liked and can have comments, so i created a parent entity table,
Table : Entity
id : 'Primary key'
and
Table : Links
id : 'Primary key'
entity_id : 'FK'
now when i create newsfeed, how i will be able to fetch links and photos by entity table ?
mean
Select * from Entity
will just give entity ids, but how to know is that link or photo or which table to query next ??
Will I have to add a Type column to Entity table? Or another solution join etc? I don't know about them, so just give me that term i will check that on internet, thanks