I am trying to create a messaging system for my users but I’m having a
hard time designing my db. This is what i have in mind, but I am not
sure if its the best approach.
user has_one inbox
user has_one outbox
inbox has_many messages
outbox has_many messages
box_id (refers to either inbox or outbox - how?)
msg_status (new, sent, read, deleted, etc.)
does this make sense? is there a better way of acheiving this? since
both inbox and outbox both have many messages, how do I created the
association between them? will the addition of a from_id and to_id in
my messages table slow anything down? is there a better way or an OO
way of getting this information w/o hitting the db alot?