Discord
Complete database schema for a Discord-like community platform featuring guild servers with role-based permissions, text and voice channels, thread messaging, emoji reactions, direct messaging, bot integrations, invite management, audit logs, and ban management.
gamingcommunityvoicemessagingreal-time
MySQL10 cols
Num
PK
AI
FK
Null
Physical Name
Type
Default
Comment
Unique user identifier
Username with discriminator e.g. user#1234
4-digit discriminator number
User email address
Hashed password
Profile avatar image URL
Whether this account is a bot
Whether email is verified
Account creation timestamp
Last update timestamp
IXUQCK|💬
MySQL12 cols
Num
PK
AI
FK
Null
Physical Name
Type
Default
Comment
Unique guild (server) identifier
Guild display name
Guild description shown to members
Guild owner user
Guild icon image URL
Guild banner image URL
Voice server region
Member verification requirement 0-4
Total number of guild members
Whether guild is discoverable
Guild creation timestamp
Last update timestamp
IXUQCK|💬
MySQL8 cols
Num
PK
AI
FK
Null
Physical Name
Type
Default
Comment
Unique guild membership record
Guild joined
Member user
Member nickname within this guild
When user joined the guild
Server mute expiration timestamp
Whether member is server-deafened
Last update timestamp
IXUQCK|💬
MySQL10 cols
Num
PK
AI
FK
Null
Physical Name
Type
Default
Comment
Unique role identifier
Guild this role belongs to
Role display name
Role color as integer RGB value
Bitfield of role permissions
Role hierarchy position, higher = more privileged
Whether role members are displayed separately
Whether role can be mentioned
Role creation timestamp
Last update timestamp
IXUQCK|💬
MySQL5 cols
Num
PK
AI
FK
Null
Physical Name
Type
Default
Comment
Unique member-role assignment
Guild member
Role assigned
When role was assigned
User who assigned the role
IXUQCK|💬
MySQL11 cols
Num
PK
AI
FK
Null
Physical Name
Type
Default
Comment
Unique channel identifier
Guild this channel belongs to, null for DMs
Channel name
Channel type: text, voice, announcement, stage, forum
Channel topic description
Channel ordering position
Whether channel is age-restricted
Seconds between messages per user
Category channel this belongs to
Channel creation timestamp
Last update timestamp
IXUQCK|💬
MySQL11 cols
Num
PK
AI
FK
Null
Physical Name
Type
Default
Comment
Unique message identifier, also used as snowflake
Channel where message was sent
User who sent the message
Message text content, null for embed-only
Message type: default, reply, thread_created, pin
Referenced message if this is a reply
Whether message is pinned in channel
Whether message was edited
Message send timestamp
Last edit timestamp
Soft-delete timestamp
IXUQCK|💬
MySQL6 cols
Num
PK
AI
FK
Null
Physical Name
Type
Default
Comment
Unique reaction record
Message that was reacted to
User who reacted
Custom emoji used, null if standard Unicode
Emoji name or Unicode character
When reaction was added
IXUQCK|💬
MySQL7 cols
Num
PK
AI
FK
Null
Physical Name
Type
Default
Comment
Unique emoji identifier
Guild this custom emoji belongs to
Emoji name used in :name: syntax
Emoji image CDN URL
User who uploaded the emoji
Whether emoji is animated GIF
Emoji creation timestamp
IXUQCK|💬
MySQL6 cols
Num
PK
AI
FK
Null
Physical Name
Type
Default
Comment
Unique DM channel identifier
Whether this is a group DM
Group DM name, null for 1:1
Group DM owner, null for 1:1
DM creation timestamp
Last message timestamp
IXUQCK|💬
MySQL5 cols
Num
PK
AI
FK
Null
Physical Name
Type
Default
Comment
Unique DM participant record
DM conversation
Participant user
When user joined the DM
Timestamp of last read message
IXUQCK|💬
MySQL9 cols
Num
PK
AI
FK
Null
Physical Name
Type
Default
Comment
Unique thread identifier
Parent channel this thread belongs to
Message that started the thread
Thread display name
Whether thread is archived
Whether thread is locked for new messages
Total messages in thread
Thread creation timestamp
When thread was archived
IXUQCK|💬
MySQL9 cols
Num
PK
AI
FK
Null
Physical Name
Type
Default
Comment
Unique invite identifier
Invite code string
Guild this invite grants access to
Channel to land in after accepting
User who created the invite
Maximum number of uses, null for unlimited
Current number of times invite was used
Invite expiration timestamp
Invite creation timestamp
IXUQCK|💬
MySQL7 cols
Num
PK
AI
FK
Null
Physical Name
Type
Default
Comment
Unique ban record identifier
Guild where ban was issued
Banned user
Moderator who issued the ban
Ban reason
When ban was issued
Ban expiration for temporary bans
IXUQCK|💬
MySQL8 cols
Num
PK
AI
FK
Null
Physical Name
Type
Default
Comment
Unique audit log entry identifier
Guild where action occurred
User who performed the action
Action type e.g. member_kick, role_create
ID of the affected entity
JSON diff of what changed
Moderator-provided reason for action
When action was performed
IXUQCK|💬
Press enter or space to select a node. You can then use the arrow keys to move the node around. Press delete to remove it and escape to cancel.
Press enter or space to select an edge. You can then press delete to remove it or escape to cancel.
Created with ERD Studio
Tables in this template
usersUsers
10 colsguildsGuilds
12 colsguild_membersGuild Members
8 colsrolesRoles
10 colsmember_rolesMember Roles
5 colschannelsChannels
11 colsmessagesMessages
11 colsmessage_reactionsMessage Reactions
6 colsemojisEmojis
7 colsdirect_messagesDirect Messages
6 colsdm_participantsDM Participants
5 colsthreadsThreads
9 colsinvitesInvites
9 colsbansBans
7 colsaudit_logsAudit Logs
8 colsRelated Templates
View all templates →GitHub
CloneCode hosting platform with repositories, issues, pull requests, and CI/CD
PostgreSQL16 tables
developer-toolsgitcollaboration+2
Web App
Netflix
CloneVideo streaming platform with content catalog, profiles, subscriptions, and recommendations
PostgreSQL15 tables
streamingvideosubscription+2
Web App
Spotify
CloneMusic streaming platform with tracks, artists, albums, playlists, and social features
PostgreSQL18 tables
musicstreamingplaylist+2
Web App
Slack
CloneTeam messaging platform with workspaces, channels, threads, and integrations
PostgreSQL14 tables
messagingcollaborationteam+2
Web App