开发者

Conversation system [closed]

开发者 https://www.devze.com 2023-03-31 03:21 出处:网络
It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical andcannot be reasonably answered in its current form. For help clari
It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center. 开发者_运维技巧 Closed 11 years ago.

Am trying to build a conversation system for users on a web app am working on. At the the moment am quite confused on how to setup the database tables. for now i have a table with fields this

  • C_id

  • Message

  • S_id
  • R_id
  • read
  • date_time


Assuming your table is a conversation table (C_id), I would have three tables in all:

  1. Conversation
  2. Message
  3. User

You look to have the third, but have collapsed the other two together. The relevant fields would be:

User
   U_id (PK)
Conversation
   C_id (PK)
   R_id (FK on U_id)
   S_id (FK on U_id)
   fields relating to the conversation only - eg  the date-time it started.
Message
   M_id (PK)
   Text
   Date_time
   Has_been_read
   Author_id (FK on U_id)
   Conversation_id (FK on C_id)
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号