LINE

Tables (15)

Attatchment (attatchments)

  • PK (id) — bigint — Primary key — NOT NULL
  • File url (file_url) — string — NOT NULL
  • File type (file_type) — string — NOT NULL
  • File size (file_size) — string — NOT NULL
  • Created at (created_at) — datetime — NOT NULL
  • Message id (message_id) — bigint — Foreign key → Message.PK — NOT NULL

Call log (call_logs)

  • PK (id) — bigint — Primary key — NOT NULL
  • Chat id (chat_id) — bigint — Foreign key → Chat.PK — NOT NULL
  • User id (user_id) — bigint — Foreign key → User.PK — NOT NULL
  • Call type (call_type) — bigint — Foreign key → Call type.PK — NOT NULL
  • Started at (started_at) — datetime — NOT NULL
  • Ended at (ended_at) — datetime — NOT NULL
  • Is missed (is_missed) — boolean — NOT NULL

Call type (call_types)

  • PK (id) — bigint — Primary key — NOT NULL
  • Call type (call_type) — enum — NOT NULL — audio, video

Chat (chats)

  • PK (id) — bigint — Primary key — NOT NULL
  • Title (title) — string — NOT NULL
  • Created at (created_at) — datetime — NOT NULL
  • Updated at (updated_at) — datetime — NOT NULL
  • Chat type (chat_type) — bigint — Foreign key → Chat type.PK — NOT NULL

Chat type (chat_types)

  • PK (id) — bigint — Primary key — NOT NULL
  • Chat type (chat_type) — enum — NOT NULL — private, group

Chat user mapping (chat_user_mappings)

  • User id (user_id) — bigint — Foreign key → User.PK — NOT NULL
  • Chat id (chat_id) — bigint — Foreign key → Chat.PK — NOT NULL
  • Joined at (joined_at) — datetime — NOT NULL
  • Mute (is_muted) — boolean — NOT NULL

Friend (friends)

  • PK (user_id) — bigint — Foreign key → User.PK — NOT NULL
  • PK (friend_id) — bigint — Foreign key → User.PK — NOT NULL
  • Status (status) — enum — NOT NULL — pending,accepted,blocked
  • Created at (created_at) — datetime — NOT NULL

Message (messages)

  • PK (id) — bigint — Primary key — NOT NULL
  • Chat id (chat_id) — bigint — Foreign key → Chat.PK — NOT NULL
  • User id (sender_id) — bigint — Foreign key → User.PK — NOT NULL
  • Message type (message_type) — bigint — Foreign key → Message_type.PK — NOT NULL
  • Content (content) — text — NOT NULL
  • Created at (created_at) — datetime — NOT NULL
  • Deleted at (deleted_at) — datetime — NOT NULL
  • Stamp (stamp_id) — bigint — Foreign key → Stamp.PK

Message info (message_infos)

  • User id (user_id) — bigint — Foreign key → User.PK — NOT NULL
  • Message id (message_id) — bigint — Foreign key → Message.PK — NOT NULL
  • Delivered at (delivered at) — datetime
  • Read at (read_at) — datetime

Message reaction (message_reactions)

  • PK (user_id) — bigint — Foreign key → User.PK — NOT NULL
  • PK (message_id) — bigint — Foreign key → Message.PK — NOT NULL
  • Type (type_id) — biginy — Foreign key → Message reaction type.PK — NOT NULL

Message reaction type (message_reaction_types)

  • PK (id) — biginy — Primary key — NOT NULL
  • Reaction type (reaction_type) — enum — NOT NULL

Message_type (message_types)

  • PK (id) — bigint — Primary key — NOT NULL
  • Type (type) — enum — NOT NULL — Text,Stamp, Image, Audio, Video, File

Stamp (stamps)

  • PK (id) — bigint — Primary key — NOT NULL
  • Name (name) — string — NOT NULL
  • Image URL (image_url) — string — NOT NULL
  • Created at (created_at) — datetime — NOT NULL
  • Package id (package_id) — bigint — Foreign key → Stamp package.PK — NOT NULL

Stamp package (stamp_packages)

  • PK (id) — bigint — Primary key — NOT NULL
  • Name (name) — string — NOT NULL
  • Creator (creator) — bigint — Foreign key → User.PK — NOT NULL
  • Description (description) — string — NOT NULL
  • Created at (created _at) — datetime — NOT NULL
  • Updated at (updated_at) — datetime — NOT NULL

User (users)

  • PK (id) — bigint — Primary key — NOT NULL
  • Phone number (phone_number) — string — NOT NULL — Unique
  • Email (email) — string — NOT NULL — Unique
  • Passwrod hash (password_hash) — string — NOT NULL
  • User name (username) — string — NOT NULL
  • Profile picture (profile_picture) — string
  • Status message (status_message) — string
  • Created at (created_at) — datetime — NOT NULL
  • Updated at (updated_at) — datetime — NOT NULL
  • Deleted at (deleted_at) — datetime
  • Last login (last_login) — datetime — NOT NULL