reports table

The reports table in the Forum Database Schema schema has 9 columns, keyed by id, with 4 foreign keys to users, posts and topics. 1 column in moderation_actions references it.

Exactly one of the three target columns is set, enforced by a check constraint. The status index is the moderation queue.

Columns (9)

Columns of the reports table
ColumnTypeConstraintsDescription
iduuidprimary key
reporter_iduuidnot null, references users.id
post_iduuidreferences posts.id
topic_iduuidreferences topics.id
reported_user_iduuidreferences users.id
reasonreport_reasonnot null
detailsvarchar(1000)
statusreport_statusnot null
created_attimestamptznot null

Indexes (2)

  • (status, created_at)
  • (reported_user_id)

Relationships