reports table

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

Exactly one of the three target columns is set, enforced by a check constraint.

Columns (9)

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

Indexes (2)

  • (status, created_at)
  • (reported_user_id)

Relationships