开发者

Basic Database Design

This question would be a bit childish, I have three tables, users, usergroups and contacts. In my system, the end user can create a contact and subsequently he\she may define the visib开发者_开发知识库ility of the contact by setting only for that user, or for a set of users or a set of usergroups. So I am wondering, how my database design would be, it should be many to many between users and contacts or many to many between usergroups and contacts. Definitely there is a one to many relationship between users and usergroups.

Thanks Thurein


If you have the possibility to set the visibility for a set of users or a set of usergroups then you need both m2m tables you mentioned. One contacts_users and one contacts_usergroups.

What I've said is true if "set of users" is different from a single "usergroup".

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜