I've got a database with two main tables. One is 'users' with approximately 35 records which is not likely to increase much, the other is 'companies' with 7000+ records, more being added every week.
Now, each company record has been either visible or not but when visibile they are available to all users. Suddenly there is a requirement to have some users who can only access some companies. For example, 'user1' can only see 400 of the companies. There are no real rules to this, the admin would like to choose which companies they can see.
I've no problem with the interface, I can handle that, but I'm looking for advice on the best way to handle the database. Do I have a new table to join to with a userID and a companyID? Only problem is with this approach, I can see there being tens of thousands of records in the lookup (it would need to be populated initially with all users seeing all companies).
Or perhaps a comma seperated list of all the companies a user can see in one of the fields of the user table?
As I say, ideas welcome, I'm sure there's a simple way of handling this that I've missed.
Now, each company record has been either visible or not but when visibile they are available to all users. Suddenly there is a requirement to have some users who can only access some companies. For example, 'user1' can only see 400 of the companies. There are no real rules to this, the admin would like to choose which companies they can see.
I've no problem with the interface, I can handle that, but I'm looking for advice on the best way to handle the database. Do I have a new table to join to with a userID and a companyID? Only problem is with this approach, I can see there being tens of thousands of records in the lookup (it would need to be populated initially with all users seeing all companies).
Or perhaps a comma seperated list of all the companies a user can see in one of the fields of the user table?
As I say, ideas welcome, I'm sure there's a simple way of handling this that I've missed.