educative.io

Educative

What if the UserId and the EntityId will be the same?

What if the UserId and the EntityId will be the same, because then in UserFollow table there will be a collision ?

1 Like
  1. we can certainly make sure its different by having a separate key generation service to generate Ids for both. but i dont feel the need of this complexity…
  2. maybe append the type in the PK.

suggestions ?

there should be Entity_Type field needed in post.

1 Like

we can easily say Entity is a type of User, and has a bool col in the User table as IsEntity… doesn’t need to be that complex… and store the extended details of an Entity (Legal name, Desc,…) in a separate table