How to relate the middle table with One or Many relationship

database-design

I am currently developing a simple CRM system. These are my tables: users, roles, role_users, customers.

enter image description here

Rules:

  • A user can only be assign with a single role
  • A role can have a 1 or many users
  • A Customer is assigned to a user

Question:
Did I mark the correct relationship in the screenshot above?

Best Answer

If a user can have no more than a single role, and this will ever change, then put role_id directly on the user table, then the relationship between role table and user table is a single role to many users.