polls table
The polls table in the Social Media Database Schema schema has 5 columns, keyed by id, with 1 foreign key to posts. 1 column in poll_options references it.
One poll per post. Results are counted from poll_votes, never stored on the option.
Columns (5)
| Column | Type | Constraints | Description |
|---|---|---|---|
| id | uuid | primary key | |
| post_id | uuid | unique, not null, references posts.id | |
| question | varchar(255) | not null | |
| allows_multiple | boolean | not null | |
| closes_at | timestamptz | not null |
Relationships
polls.post_idreferencesposts.idpoll_options.poll_idreferencespolls