user_flairs table

The user_flairs table in the Reddit Clone Database Schema schema has 6 columns, with 4 foreign keys to subreddits, users and flairs.

Flair is per community: the same person is a different thing in r/rust and r/cooking. text_override exists because many subs let a member edit the label while keeping the template styling.

Columns (6)

Columns of the user_flairs table
ColumnTypeConstraintsDescription
subreddit_iduuidnot null, references subreddits.id
user_iduuidnot null, references users.id
flair_iduuidreferences flairs.id
text_overridevarchar(64)
assigned_byuuidreferences users.id
assigned_attimestamptznot null

Indexes (1)

  • (user_id)

Relationships