chat-site

Tables (4)

category

  • category_id — int — Primary key — NOT NULL
  • room_id — int — Foreign key → room.room_id — NOT NULL
  • name — string

message

  • message_id — int — Primary key — NOT NULL
  • user_id — int — Foreign key → user.user_id — NOT NULL
  • category_id — int — Foreign key → category.category_id — NOT NULL
  • room_id — int — Foreign key → category.room_id — NOT NULL
  • text — string
  • createdAt — Datetime

room

  • room_id — int — Primary key — NOT NULL
  • name — string
  • user_id — int — Foreign key → user.user_id — NOT NULL

user

  • user_id — int — Primary key — NOT NULL
  • avatarUrl — string
  • username — string
  • email — string
  • password — string
  • emailSecret — string
  • phoneNum — string
  • phoneSecret — string
  • bio — string
  • createdAt — Datetime
  • room_id — int — Foreign key → room.room_id — NOT NULL
  • sender_id — int — Foreign key → user.user_id — NOT NULL
  • receiver_id — int — Foreign key → user.user_id — NOT NULL