subreddit_karma table

The subreddit_karma table in the Reddit Clone Database Schema schema has 5 columns, with 2 foreign keys to users and subreddits.

A rollup of karma_events per community, kept because AutoMod checks it on every single submission and a live aggregate there would be the slowest thing on the site.

Columns (5)

Columns of the subreddit_karma table
ColumnTypeConstraintsDescription
user_iduuidnot null, references users.id
subreddit_iduuidnot null, references subreddits.id
post_karmaintegernot null
comment_karmaintegernot null
updated_attimestamptznot null

Indexes (1)

  • (subreddit_id, comment_karma)

Relationships