Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Database & SysAdmin
  3. Database
  4. problem modeling messages tables

problem modeling messages tables

Scheduled Pinned Locked Moved Database
help
5 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    ahmadiss
    wrote on last edited by
    #1

    hello, in my application I have three tables: user, admin, operator each of these three can send a message to another the message can be a response to a message sent by the other or it may correspond to a command (because the user places orders to the admin and the admin can send a message on this order (Order approved, rejected, in process)) all of that concern an application of managment printing my problem is to determinate how much I need to message tables (because there is a lot of messages (corresponding to order, response, simple message, which is sender and receiver....)) here is the image of my model http://postimage.org/image/fezebtifp/ Can you help me or give me examples of similar cases thank you very much

    P 1 Reply Last reply
    0
    • A ahmadiss

      hello, in my application I have three tables: user, admin, operator each of these three can send a message to another the message can be a response to a message sent by the other or it may correspond to a command (because the user places orders to the admin and the admin can send a message on this order (Order approved, rejected, in process)) all of that concern an application of managment printing my problem is to determinate how much I need to message tables (because there is a lot of messages (corresponding to order, response, simple message, which is sender and receiver....)) here is the image of my model http://postimage.org/image/fezebtifp/ Can you help me or give me examples of similar cases thank you very much

      P Offline
      P Offline
      PIEBALDconsult
      wrote on last edited by
      #2

      I wrote a simple messaging application a few years ago and used something like the following: Message table: MessageID -- the ID of message ParentID -- the ID of the immediate parent message ThreadID -- the ID of the first message in the thread SenderID -- the ID of the sender TimeSent -- timestamp Content... (whatever other columns you require) Recipient table: MessageID -- the ID of the message RecipientID -- the ID of the recipient Read/Unread indicator This allowed for multiple recipients for each message. I used GUIDs for IDs, but you could use INTs if you like.

      A 1 Reply Last reply
      0
      • P PIEBALDconsult

        I wrote a simple messaging application a few years ago and used something like the following: Message table: MessageID -- the ID of message ParentID -- the ID of the immediate parent message ThreadID -- the ID of the first message in the thread SenderID -- the ID of the sender TimeSent -- timestamp Content... (whatever other columns you require) Recipient table: MessageID -- the ID of the message RecipientID -- the ID of the recipient Read/Unread indicator This allowed for multiple recipients for each message. I used GUIDs for IDs, but you could use INTs if you like.

        A Offline
        A Offline
        ahmadiss
        wrote on last edited by
        #3

        I think you forget the receiver_id, and what is the utility of thread_id

        P 1 Reply Last reply
        0
        • A ahmadiss

          I think you forget the receiver_id, and what is the utility of thread_id

          P Offline
          P Offline
          PIEBALDconsult
          wrote on last edited by
          #4

          ahmadiss wrote:

          I think you forget the receiver_id

          That's the recipient.

          ahmadiss wrote:

          what is the utility of thread_id

          Helps find all messages in a thread quickly.

          A 1 Reply Last reply
          0
          • P PIEBALDconsult

            ahmadiss wrote:

            I think you forget the receiver_id

            That's the recipient.

            ahmadiss wrote:

            what is the utility of thread_id

            Helps find all messages in a thread quickly.

            A Offline
            A Offline
            ahmadiss
            wrote on last edited by
            #5

            you are right thank you very much

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups