chat

Tables (4)

chat_room_users

  • chat_room_id — INT — Primary key — NOT NULL
  • user_id — INT — Primary key — NOT NULL
  • joined_at — TIMESTAMP — NOT NULL

chat_rooms

  • id — SERIAL
  • name — VARCHAR(100)
  • is_group — BOOLEAN — NOT NULL
  • created_at — TIMESTAMP — NOT NULL

messages

  • id — SERIAL
  • chat_room_id — INT — NOT NULL
  • sender_id — INT — NOT NULL
  • content — TEXT — NOT NULL
  • sent_at — TIMESTAMP — NOT NULL

users

  • id — SERIAL
  • username — VARCHAR(50) — NOT NULL
  • created_at — TIMESTAMP — NOT NULL