Click here to Skip to main content
15,887,320 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello, I have a system in which a number of drivers are supposed to register and work. There are also some individuals who act as owners of goods. The owners of goods can announce their loads in their own panel, and the drivers can see these loads. I want to know the overall structure of the database. Should I separate the tables for these three types of users (drivers, managers, and owners of goods), or should I keep them all in one table and manage them based on their roles and permissions?

What I have tried:

This is just a question for guidance, I haven't tried anything yet. Basically, I want the login and logout process in the system to be based on sending a one-time password to the mobile phone.
Posted
Updated 9-Dec-23 21:52pm
Comments
[no name] 10-Dec-23 11:56am    
They're all "clients". Even employees; they just have different roles based on context. You have a "shipment" (for example) that includes a "manager"; some goods with an "owner"; and finally a "driver". Put a "client" in each one of those slots. The "manager" could be "driving" his own goods around; meaning, one person could hold all three positions at the same time.
CHill60 11-Dec-23 6:09am    
I agree with Gerry's comment, but would also add you need more than one table. Store information about an "individual" with all kinds of individuals stored in there. Have another table for roles - list the roles and include characteristics of each role if appropriate. Between the two you need an intersection table that links each individual to the roles they can perform. This allows for a single individual to perform more than one role. Depending on the complexity of your system you might also want a table of Permissions with an intersection table between Roles and Permissions

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month


CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900