Owais Hasan
Owais Hasan

Reputation: 13

Query Regarding Relation in ERD using DBDesigner

How can we represent a relation where there is no need to add a foreign key in the table in DBDesigner? For Example, If i have 2 Tables As:

1) Admin 2) Machine

Suppose the relation "Admin can Add machines",

there is no need of Admin table's primary key to go in Machine's table as foreign key. Or you can say that i don't want to add it. But still i want to show this relation in my ERD. How can i do it using DBDesigner?

Upvotes: 0

Views: 134

Answers (1)

Antoan Milkov
Antoan Milkov

Reputation: 2228

The best way is to create separate table Permissions.
Then there will be a row with specific permission Add machines
This way you can assign different permissions to different users.

Obviously you will need 2 more tables for this to work: Users where the user data is kept and say user_permissions with 2 fields only user_id & permission_id where you keep the info which user has which permission.

This is the right way to design scalable permissions that can expand and accommodate any set of permissions.

Upvotes: 1

Related Questions