Tabo
07-29-2009, 06:14 AM
OK so I have a PM system like this forum. I want to allow users to add up to x custom folders to move messages to (and auto-send them to), but every method I use to try and implement this is very messy, any suggestions?
|
Click to See Complete Forum and Search --> : DB structure advice: custom message folders Tabo 07-29-2009, 06:14 AM OK so I have a PM system like this forum. I want to allow users to add up to x custom folders to move messages to (and auto-send them to), but every method I use to try and implement this is very messy, any suggestions? NogDog 07-29-2009, 04:01 PM Not sure there's enough information here to make any solid suggestions. Is it a one-to-many relationship between folder and messages, or could a given message belong to more than one folder? Same question between users and folders just to be sure, I suppose? I'm guessing you probably have a `user` table and a `message` table? You'll probably want a separate `folder` table with a column pointing to the `user` primary key. Now if you only ever expect a message to reside in a single folder at any given time, then you can just add a column to the message table to point to the `folder` table. If, however, you think you may (or already know you will) have a need for a message to exist in more than one folder, then you would need a separate `message_to_folder` relation table, with a minimum of 2 columns: message primary key and folder primary key (which together could be a 2-column unique (even primary) key. webdeveloper.com
Copyright Internet.com Inc., All Rights Reserved. |