Hey,
I think my DB has very standard parts and I don't want to reinvent the wheel again so I wonder if there are some ready and widely used DB templates for what I need -
My database is all about customers, so I got a bunch of tables related to them.
Now what I'm trying to design is how I add ALL the users of my web application in the DB design.
I've got 4 types of users- Admin, manager, secretary and all the customers. They ALL need access to my application but each of them has different functions. For example the manager can see all the data about the customers, but each customer can see only his private data..
So this reminds me of the way forums work, but I don't know what a forum DB looks like..
Should I do it like this? :
tables:
tblCustomers: customerId, name, address, etc..
tblMembers: username, password, userTypeId. (in case it's a customer his customerId is the username, and other users will get a new username(.
tblUserType: typeId (d1(admin),2(customer),3(manager), 4(secretary()
OR
tblCustomers: customerId(as username),password, name, adress, etc..
tblMembers: username, password, usertypeId .(this table is for everyone besides the customers(
and no usertype table needed at all..
any links to helpful sites would be appreciated!