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)

Columns of the polls table
ColumnTypeConstraintsDescription
iduuidprimary key
post_iduuidunique, not null, references posts.id
questionvarchar(255)not null
allows_multiplebooleannot null
closes_attimestamptznot null

Relationships