For example, there is a posts table and a users table, and there is a likes table and a bookmarks table.
Both likes and bookmarks have FK keys of the top table posts and users
If you leave only one like table and make a parentTable column and parentId column
FROM
parentTable = "posts" AND
parentId = 1
Is it better to select like this?
Make a table called posts_likes and fill in the parentId
FROM
parentId = 1
I don't know if it's good to do it this way.
mysql
In this case, it seems that the design concept will eventually have to be decided.
© 2024 OneMinuteCode. All rights reserved.