modmail_conversations table

The modmail_conversations table in the Reddit Clone Database Schema schema has 10 columns, keyed by id, with 3 foreign keys to subreddits and users. 1 column in modmail_messages references it.

Modmail is a conversation addressed to a TEAM, which is why it has its own table with an assignee and a state rather than being a message with many recipients. is_internal marks a mod-only discussion thread the participant never sees.

Columns (10)

Columns of the modmail_conversations table
ColumnTypeConstraintsDescription
iduuidprimary key
subreddit_iduuidnot null, references subreddits.id
participant_iduuidreferences users.id
subjectvarchar(200)not null
statemodmail_statenot null
is_internalbooleannot null
assigned_touuidreferences users.id
message_countintegernot null
last_message_attimestamptznot null
created_attimestamptznot null

Indexes (3)

  • (subreddit_id, state, last_message_at)
  • (participant_id)
  • (assigned_to, state)

Relationships