votes table
The votes table in the Forum Database Schema schema has 4 columns, with 2 foreign keys to users and posts.
value is +1 or -1, constrained by a check. The composite key makes a vote idempotent and lets a user flip it with an UPDATE rather than accumulating rows.
Columns (4)
Indexes (1)
(post_id)