Q: Mysql database design with users, groups teams and more Need help trying to figure out what the best way to go would be when different kind of objects from different tables with their own auto incremented id need to interact with the same object.
Facebook have this for example. You can both like a post as a group/page and more but you can also like a post as a single user.
So i am trying to figure out how i can achieve this in the best and most efficient way.
This is what i have so far and how i think it could work but i would really need a second opinion on this.
Lets say i have the following tables for example
users
+----+----------+----------+-----------+
| id | username | password | more cols |
+----+----------+----------+-----------+
|  1 | User1    | changeme | etc       |
|  2 | User2    | changeme | etc       |
|  3 | User3    | changeme | etc       |
+----+----------+----------+-----------+

groups
+----+------------------+-----------+
| id |       name       | more cols |
+----+------------------+-----------+
|  1 | We who like cats | etc       |
|  2 | Funny videos     | etc       |
|  3 | Nice food pics   | etc       |
+----+------------------+-----------+

teams
+----+----------------+-----------+
| id |    teamname    | more cols |
+----+----------------+-----------+
|  1 | Team Alpha     | etc       |
|  2 | Team Golden    | etc       |
|  3 | Team Foo       | etc       |
+----+----------------+-----------+

All of these objects should be able to interact with something created by another group, user, team or whatever. Now lets say that both team alpha and user3 likes something that the group funny videos has uploaded. I then need to know if there is a user, team or group that liked this to get the correct properties of the object that liked this upload.
Due to the fact that a user, team or group can have the same id i need something unique to know if i should look in the user, group or team table.
So i thought if i create the following table below that is used to interact with everything on the website and just points to the correct table depending on the type_id.
type_id 1 = users
type_id 2 = groups
type_id 3 = teams
+----+-----------+---------+
| id | object_id | type_id |
+----+-----------+---------+
|  1 |         1 |       1 |
|  2 |         1 |       2 |
|  3 |         2 |       1 |
|  4 |         2 |       3 |
|  5 |         1 |       3 |
+----+-----------+---------+

I then use object_id for every interaction that the user, group, team or whatever does.
Really appreciate all thoughts on this if there is a better way to do it :)

A: I believe there is another approach . 
I can't comment that is why I answered .
in your "LIKES" tables you can have 
team_id
group_id
user_id

So you will have smth like this 
 +----+-----------+---------+---------+---------+
 | id | object_id | team_id |group_id |user_id  | 
 +----+-----------+---------+---------+---------+
 |  1 |         1 |       1 |NULL     |1        |
 |  2 |         2 |     NULL|1        |NULL     |
 +----+-----------+---------+---------++---------+

You can have team_id , group_id, user_id either 0 or NULL when team/group/user has not liked and 1 if they do .
Once the row is generated for user or team next time you look if page has any like yet and if it does you just add team_id which liked the page or the post .
Hope it helps .
