Database design for email messaging system

后端 未结 9 900
情书的邮戳
情书的邮戳 2021-01-29 22:58

I want to make an email messaging system like gmail have. I would like to have following option: Starred, Trash, Spam, Draft, Read, Unread. Right now I have the below following

9条回答
  •  长发绾君心
    2021-01-29 23:55

    If I were you I would set two flags one for sender and other one for receiver if both flags are true then message should be deleted from database otherwise keep that in database but hide it from who deleted it.

    Do same thing for trash. You may want to run cron or check manually if both sender and receiver delete the message then remove it from database.

提交回复
热议问题