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)

Columns of the poll_votes table
ColumnTypeConstraintsDescription
poll_option_iduuidnot null, references poll_options.id
user_iduuidnot null, references users.id
voted_attimestamptznot null

Indexes (1)

  • (user_id)

Relationships