moderation_actions table
The moderation_actions table in the Social Media Database Schema schema has 9 columns, keyed by id, with 4 foreign keys to reports, users and posts.
Append-only. A suspension is not a flag on users, it is a row here with an expires_at, so the history survives the appeal.
Columns (9)
| Column | Type | Constraints | Description |
|---|---|---|---|
| id | uuid | primary key | |
| report_id | uuid | references reports.id | |
| moderator_id | uuid | not null, references users.id | |
| target_user_id | uuid | references users.id | |
| target_post_id | uuid | references posts.id | |
| action | moderation_action_type | not null | |
| reason | varchar(1000) | ||
| expires_at | timestamptz | ||
| created_at | timestamptz | not null |
Indexes (1)
(target_user_id, created_at)
Relationships
moderation_actions.report_idreferencesreports.idmoderation_actions.moderator_idreferencesusers.idmoderation_actions.target_user_idreferencesusers.idmoderation_actions.target_post_idreferencesposts.id