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)
| Column | Type | Constraints | Description |
|---|---|---|---|
| id | uuid | primary key | |
| reporter_id | uuid | not null, references users.id | |
| reported_user_id | uuid | references users.id | |
| post_id | uuid | references posts.id | |
| comment_id | uuid | references comments.id | |
| reason | report_reason | not null | |
| details | varchar(1000) | ||
| status | report_status | not null | |
| created_at | timestamptz | not null |
Indexes (2)
(status, created_at)(reported_user_id)
Relationships
reports.reporter_idreferencesusers.idreports.reported_user_idreferencesusers.idreports.post_idreferencesposts.idreports.comment_idreferencescomments.idmoderation_actions.report_idreferencesreports