[Linux-disciples] database design question

Jamie Forrest jaf at honksandsirens.com
Wed Feb 6 09:01:13 EST 2008


Okay, let's say I want to build something like a filesystem with  
users, folders, documents, and permissions to read or read/write those  
documents. (Talk about reinventing the wheel.) What does the  
relationship diagram look like? Here's what I have, does it look right?

A User has many folders. A Folder has many folders. A Folder has  
foreign keys for a User and for a Folder (if the foreign key points to  
itself, then it's the top level folder.)
A Folder has many documents. A Document has a foreign key for a folder.
A User has many Permissions. A Document has many Permissions. A  
Permission has foreign keys for both a User and a Document.

How does this look? (Oh I should add that Folders do not need  
Permissions).
Jamie


On Feb 6, 2008, at 7:16 AM, Adam Rosi-Kessel wrote:

> Jamie Forrest wrote, on 2/5/2008 11:39 PM:
>> Anyone here know a thing or two about designing databases?
>
> Yes.
> _______________________________________________
> Linux-disciples mailing list
> Linux-disciples at lists.bostoncoop.net
> http://lists.bostoncoop.net/mailman/listinfo/linux-disciples
>



More information about the Linux-disciples mailing list