[Linux-disciples] database design question
Adam Rosi-Kessel
adam at rosi-kessel.org
Wed Feb 6 10:06:29 EST 2008
That is certainly re-inventing the wheel. Not sure what your
"permissions" table looks like; that may not be quite right. Also, at
least in some implementations, folders and files would be in the same
table and just have different attributes to distinguish their behaviors.
Jamie Forrest wrote, on 2/6/2008 9:01 AM:
> 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
>>
>
> _______________________________________________
> 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