subreddit_rules table

The subreddit_rules table in the Reddit Clone Database Schema schema has 8 columns, keyed by id, with 1 foreign key to subreddits. 2 columns in subreddit_bans and reports reference it.

Rules are rows so a report can cite one by id. reports.rule_id pointing here is what makes a subreddit report queue different from a site-wide one.

Columns (8)

Columns of the subreddit_rules table
ColumnTypeConstraintsDescription
iduuidprimary key
subreddit_iduuidnot null, references subreddits.id
positionsmallintnot null
short_namevarchar(100)not null
description_mdvarchar(1000)
violation_reasonvarchar(100)
applies_torule_scopenot null
created_attimestamptznot null

Indexes (1)

  • (subreddit_id, position)

Relationships