story_views table
The story_views table in the Social Media Database Schema schema has 3 columns, with 2 foreign keys to stories and users.
The composite key means a re-watch does not inflate the viewer list.
Columns (3)
| Column | Type | Constraints | Description |
|---|---|---|---|
| story_id | uuid | not null, references stories.id | |
| viewer_id | uuid | not null, references users.id | |
| viewed_at | timestamptz | not null |
Relationships
story_views.story_idreferencesstories.idstory_views.viewer_idreferencesusers.id