Reddit Clone
Complete database schema for a Reddit-like community platform featuring user accounts, subreddit communities, post submissions, nested comment threads, karma voting on posts and comments, awards system, content moderation, user flairs, post flairs, saved content, and ban management.
socialcommunityvotingforumreddit
MySQL12 cols
Num
PK
AI
FK
Null
Physical Name
Type
Default
Comment
Primary key, globally unique user identifier
Unique username used for login and display
User email address used for authentication and notifications
Bcrypt-hashed password for secure authentication
URL to the user profile picture
Total karma score accumulated from upvotes on posts and comments
Karma points earned from post upvotes
Karma points earned from comment upvotes
Whether the user email has been verified
Whether the user has site-wide admin privileges
Timestamp when the account was created
Timestamp when the account was last updated
IXUQCK|💬
MySQL12 cols
Num
PK
AI
FK
Null
Physical Name
Type
Default
Comment
Primary key, globally unique subreddit identifier
Unique subreddit name used in URL (e.g. r/technology)
Display title of the subreddit community
Detailed description of the community purpose and rules
FK to users: original creator of the subreddit
URL to the subreddit icon image
URL to the subreddit banner image displayed at the top
Denormalized count of current subreddit members
Whether the subreddit contains adult content
Whether membership requires approval from moderators
Timestamp when the subreddit was created
Timestamp when the subreddit info was last updated
IXUQCK|💬
MySQL4 cols
Num
PK
AI
FK
Null
Physical Name
Type
Default
Comment
Primary key, unique membership record identifier
FK to subreddits: the community the user joined
FK to users: the member user
Timestamp when the user subscribed to the subreddit
IXUQCK|💬
MySQL15 cols
Num
PK
AI
FK
Null
Physical Name
Type
Default
Comment
Primary key, globally unique post identifier
Post title shown in feed and listing pages
Text body of the post, nullable for link-only posts
External URL for link posts
Type of post: text, link, image, or video
FK to users: author of the post
FK to subreddits: community where the post was submitted
Net vote score (upvotes minus downvotes)
Total number of upvotes received on the post
Denormalized count of all comments on the post
Whether the post is marked as adult content
Whether new comments are disabled by a moderator
Whether the post was removed by a moderator
Timestamp when the post was submitted
Timestamp when the post was last edited
IXUQCK|💬
MySQL5 cols
Num
PK
AI
FK
Null
Physical Name
Type
Default
Comment
Primary key, unique vote record identifier
FK to posts: the post that received the vote
FK to users: the user who cast the vote
Vote direction: 1 for upvote, -1 for downvote
Timestamp when the vote was cast
IXUQCK|💬
MySQL10 cols
Num
PK
AI
FK
Null
Physical Name
Type
Default
Comment
Primary key, globally unique comment identifier
FK to posts: the post this comment belongs to
FK to users: author of the comment
FK to comments: parent comment for nested replies, null for top-level
Markdown-formatted text content of the comment
Net vote score (upvotes minus downvotes)
Nesting depth level of the comment in the thread
Whether the comment was removed by a moderator
Timestamp when the comment was posted
Timestamp when the comment was last edited
IXUQCK|💬
MySQL5 cols
Num
PK
AI
FK
Null
Physical Name
Type
Default
Comment
Primary key, unique comment vote record identifier
FK to comments: the comment that received the vote
FK to users: the user who cast the vote
Vote direction: 1 for upvote, -1 for downvote
Timestamp when the vote was cast
IXUQCK|💬
MySQL6 cols
Num
PK
AI
FK
Null
Physical Name
Type
Default
Comment
Primary key, unique award type identifier
Display name of the award (e.g. Silver, Gold, Platinum)
Description of what the award represents
URL to the award icon image displayed on posts
Number of Reddit coins required to give this award
Timestamp when the award type was created
IXUQCK|💬
MySQL5 cols
Num
PK
AI
FK
Null
Physical Name
Type
Default
Comment
Primary key, unique post award record identifier
FK to posts: the post that received the award
FK to awards: the type of award given
FK to users: the user who gave the award
Timestamp when the award was given
IXUQCK|💬
MySQL4 cols
Num
PK
AI
FK
Null
Physical Name
Type
Default
Comment
Primary key, unique saved post record identifier
FK to users: the user who saved the post
FK to posts: the post that was saved
Timestamp when the post was saved by the user
IXUQCK|💬
MySQL4 cols
Num
PK
AI
FK
Null
Physical Name
Type
Default
Comment
Primary key, unique saved comment record identifier
FK to users: the user who saved the comment
FK to comments: the comment that was saved
Timestamp when the comment was saved by the user
IXUQCK|💬
MySQL5 cols
Num
PK
AI
FK
Null
Physical Name
Type
Default
Comment
Primary key, unique post flair identifier
FK to subreddits: the community that owns this flair
Display text of the flair tag
Hex color code for the flair background
Timestamp when the flair was created
IXUQCK|💬
MySQL6 cols
Num
PK
AI
FK
Null
Physical Name
Type
Default
Comment
Primary key, unique user flair assignment identifier
FK to subreddits: the community in which the flair applies
FK to users: the user this flair is assigned to
Custom flair text displayed next to username
Hex color code for the flair background
Timestamp when the user flair was assigned
IXUQCK|💬
MySQL5 cols
Num
PK
AI
FK
Null
Physical Name
Type
Default
Comment
Primary key, unique moderator record identifier
FK to subreddits: the community being moderated
FK to users: the user with moderator role
JSON object storing granular moderator permissions
Timestamp when the user was granted moderator status
IXUQCK|💬
MySQL8 cols
Num
PK
AI
FK
Null
Physical Name
Type
Default
Comment
Primary key, unique report record identifier
FK to users: the user who submitted the report
Type of content being reported: post or comment
UUID of the reported post or comment
Selected reason for the report from predefined categories
Additional context provided by the reporter
Current status of the report: pending, reviewed, or dismissed
Timestamp when the report was submitted
IXUQCK|💬
MySQL7 cols
Num
PK
AI
FK
Null
Physical Name
Type
Default
Comment
Primary key, unique ban record identifier
FK to subreddits: the community from which the user is banned
FK to users: the user who was banned
FK to users: the moderator who issued the ban
Reason given by the moderator for the ban
Timestamp when the ban expires, null means permanent ban
Timestamp when the ban was issued
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
12 colssubredditsSubreddits
12 colssubreddit_membersSubreddit Members
4 colspostsPosts
15 colspost_votesPost Votes
5 colscommentsComments
10 colscomment_votesComment Votes
5 colsawardsAwards
6 colspost_awardsPost Awards
5 colssaved_postsSaved Posts
4 colssaved_commentsSaved Comments
4 colspost_flairsPost Flairs
5 colsuser_flairsUser Flairs
6 colsmoderatorsModerators
5 colsreportsReports
8 colsbansBans
7 colsRelated Templates
View all templates →Twitter / X
CloneMicroblogging platform with tweets, follows, likes, retweets, and DMs
PostgreSQL17 tables
socialmicrobloggingreal-time+2
Social
Photo and video sharing platform with stories, reels, explore, and direct messaging
PostgreSQL17 tables
photosocialstories+2
Social
YouTube
CloneVideo streaming platform with channels, videos, playlists, comments, and monetization
PostgreSQL15 tables
videostreamingcontent+2
Social
Professional networking platform with profiles, connections, job boards, and content
PostgreSQL15 tables
professionalnetworkingjobs+2
Social