poll_votes table
The poll_votes table in the Social Media Database Schema schema has 3 columns, with 2 foreign keys to poll_options and users.
Single-choice polls add a partial unique index on (poll_id, user_id) through the option join.
Columns (3)
| Column | Type | Constraints | Description |
|---|---|---|---|
| poll_option_id | uuid | not null, references poll_options.id | |
| user_id | uuid | not null, references users.id | |
| voted_at | timestamptz | not null |
Indexes (1)
(user_id)
Relationships
poll_votes.poll_option_idreferencespoll_options.idpoll_votes.user_idreferencesusers.id