Crazylife's avatar

To store user info with multiple role

I would like to store company and user info. How should i design my database? My user can be company or client and client might have multiple social account.

Table:

  • users (type: client / company)
  • companies
  • clients (user general info like dob, gender, etc)
  • client_profiles (social media info)

The client_profiles table's id will be used as to accept job offer or etc in future.

If i am design in this way is it ok?

0 likes
1 reply
aleahy's avatar

Sounds ok so far.

I assume there is a polymorphic relationship between users and companies/clients. So the users table will need a column for the company/client id and a column for the company/client type.

1 like

Please or to participate in this conversation.