What are the main possible tables in a system with a chat, type olx?

0

I'm "overtraveling" in how to create a chat template, in fact I'm not "traveling", I just want them to complement more things than I can see in such a complex system (At least for me) .

A chat db would consist of the following tables:

mensagens
  id: int PK AI
  emissor: varchar(255)
  destinatario: varchar(255)
  dataHora: TimeStamp

Followed by the user table:

usuario
  id: int PK AI
  email: varchar(255)
  senha: varchar(255)

"Simple" ... But how would I imagine the private interaction between two users. Example: You logged into the site, it moves you to a screen with a button, that when clicked it has the action of opening a new conversation between YOU that is logged in and the USER of the button. Would these 2 tables solve the problem? Or is it insufficient for what I want? If it does not solve, why not solve?

People, first of all, I'm quite new to the area, and to make it clear, I'm not after exercise resolutions, far from it. I just want to UNDERSTAND from more experienced people and do with my own hands.

    
asked by anonymous 30.01.2018 / 01:35

0 answers