Right now, I am just playing with the database only. I wanted to get the username of the person who have like a video. After digging some time, I found that in order to do this, I have 3 tables in database, i.e., user, userVideoHistory, video. When a user likes a video, the total like is increased in the video. I have the following database structure for User, userVideoHistory and Video respectively.
In order to get the user and like from PeerTube database, I have used the following sql query:
SELECT "video"."id", "video"."name", "video"."likes", "user"."username" FROM "video" JOIN "userVideoHistory" ON "userVideoHistory"."videoId"="video"."id" JOIN "user" ON "user"."id"="userVideoHistory"."userId";
The output is as follow:
The problem is that, when i like a video from abc, the video likes is 1 and it is ok, But the root and other user is also displayed. I just want abc information to display when abc likes a video.