Ways to check if a user liked

Imagine the following objects in your schema: Post, Likes, User.
Imagine also the following relations:

User has many Likes (own made Likes)
Post has many Likes

Likes has one User
Likes has one Post


So Likes is the join table for the many-to-many connection between "One Post has many likes (from users) and one User has many liked Posts".

If I now want to load a feed, how to effectively check, if the user liked the post, that the user see's in his feed?

Was this page helpful?