automod_rules table

The automod_rules table in the Reddit Clone Database Schema schema has 15 columns, keyed by id, with 2 foreign keys to subreddits and users. 2 columns in mod_actions and automod_matches reference it.

AutoMod rules are DATA, not code. A community changes its own filtering without a deploy, rules evaluate in priority order, and match_count tells moderators which rule is actually doing the work and which one has never fired once.

Columns (15)

Columns of the automod_rules table
ColumnTypeConstraintsDescription
iduuidprimary key
subreddit_iduuidnot null, references subreddits.id
namevarchar(100)not null
applies_torule_scopenot null
fieldautomod_fieldnot null
operatorautomod_operatornot null
patternvarchar(1000)not null
actionautomod_actionnot null
action_reasonvarchar(500)
comment_reply_mdvarchar(2000)
prioritysmallintnot null
is_enabledbooleannot null
match_countintegernot null
created_byuuidreferences users.id
updated_attimestamptznot null

Indexes (1)

  • (subreddit_id, is_enabled, priority)

Relationships