1
I have an application where the user can create a task. The task in turn can be public or private. If it is public, other users may see it and favorite it. That is, many users may prefer the same task.
I thought of creating a third table, called Favorites. In this table I will have two fields, User_id
(who is the little guy who preferred the task) and Task_id
(which is the favorite task.
When I need to show this I filter via code. All right this or you suggest me something better?
I think that’s right, put the two fields as the primary key, and think about creating a field in the task table to cache a times counter that was favorite, so you don’t need to query and count in the second table and you can sort by favorite of the most easily...
– Jader A. Wagner