user_badges table

The user_badges table in the Forum Database Schema schema has 3 columns, with 2 foreign keys to users and badges.

Composite key means a badge cannot be awarded twice. Repeatable awards would need a sequence column instead.

Columns (3)

Columns of the user_badges table
ColumnTypeConstraintsDescription
user_iduuidnot null, references users.id
badge_iduuidnot null, references badges.id
awarded_attimestamptznot null

Indexes (1)

  • (badge_id)

Relationships