mod_actions table

The mod_actions table in the Reddit Clone Database Schema schema has 12 columns, keyed by id, with 5 foreign keys to subreddits, users, reports and automod_rules.

The public moderation log, append-only. is_automated with a null moderator_id and an automod_rule_id is how a machine action is recorded, so a community can see exactly how much of its moderation is automated and which rule did it. Every removal, lock, sticky, ban and flair change lands here, which means moderator activity is itself reviewable.

Columns (12)

Columns of the mod_actions table
ColumnTypeConstraintsDescription
iduuidprimary key
subreddit_iduuidreferences subreddits.id
moderator_iduuidreferences users.id
actionmod_action_typenot null
target_user_iduuidreferences users.id
content_typecontent_type
content_iduuid
report_iduuidreferences reports.id
automod_rule_iduuidreferences automod_rules.id
is_automatedbooleannot null
detailsvarchar(1000)
created_attimestamptznot null

Indexes (4)

  • (subreddit_id, created_at)
  • (moderator_id, created_at)
  • (target_user_id, created_at)
  • (content_type, content_id)

Relationships