1

I have this database that I am creating and I need to create a system where a user as a role, because based on the username login he will be redirected to the correspondent page, and then later I want to create a table where I need to join two users with different roles for a specific subject. I want to know how can I do this the proper way.

This are my tables:

User
user_id
cellphone
name
role_id

Role
role_id
role_type (Type1,Type2,Type3)

Meeting
meeting_id 
date
user_id of type 1 //these are the two users roles that will be part of the meeting
user_id of type 2
José Nobre
  • 4,407
  • 6
  • 20
  • 40
  • I would introduce another table, `MeetingUser` (or `MeetingAttendant`) that links N users to a meeting. Meeting can probably have one specific userid of the person that organised the meeting, if you like, or you can put that informaiton in the MeetingUser table too. That way you are way more flexible in what you can store. Actually enforcing that a meeting needs to have two users or that at least one of them has to be of role 1, is something better done in the application code. – GolezTrol Aug 20 '18 at 14:57

0 Answers0