I am trying to build a messaging/chat system. which can store conversation between two people in a chronological order. Also if User A deletes the conversation User B still should have access the conversation until he wishes to delete them.
Inbox - All the messages recieved by the user from various users will be displayed with the latest message from that particular thread.
Conversation Screen - Chronological order of the conversation between the User A and User B
This is the basic structure of the database i have come up with. Should i store the messages twice in the database ?
- id
- to_id
- from_id
- message
- timestamp
- read