I am creating a communication module with email and onsite messaging. 4 questions:
1) When storing the messages, it can belong to folders (Spam, trash, inbox, outbox, etc). Are these separate tables or 1 table with just a column for “folder” which is FK to a “folder lookup table”?
2) Like on hotmail, a user can create x number of custom folders so how to represent that in the data model? I can say inbox = id 1, outbox = id 2, etc but for the custom folders like “vacation email”, “work email”, etc i am not sure how to show that in the Data model if a message resides in that folder.
3) One email goes to multiple people. Does this mean i need to have 1 row per user sent to?
4) Lastly, messages have attachments. i assume that means a separate attachments table which FK links to which ever table (s) are used for storing messages?
1&2: Folders need to be an entity, relationship MessageFolder one to many to Message
3: MessageUser entity with UserID, MessageID, Type (Sender,Recipient)
4: Seperate table for attachments (MessageAttachments).