poll_votes table

The poll_votes table in the Reddit Clone Database Schema schema has 3 columns, with 2 foreign keys to users and poll_options.

Separate from post_votes because a poll choice is not an upvote and must never touch karma. vote_count on poll_options is the cache over this table.

Columns (3)

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

Indexes (1)

  • (option_id)

Relationships