awards table

The awards table in the Reddit Clone Database Schema schema has 11 columns, keyed by id, with 1 foreign key to subreddits. 1 column in award_gifts references it.

The catalog of purchasable awards. subreddit_id set means a community award, null means site-wide. is_active retires an award without deleting it, so old gifts still render.

Columns (11)

Columns of the awards table
ColumnTypeConstraintsDescription
iduuidprimary key
codevarchar(40)unique, not null
namevarchar(80)not null
descriptionvarchar(255)
tieraward_tiernot null
coin_priceintegernot null
icon_urlvarchar(500)
grants_premium_dayssmallintnot null
grants_coinsintegernot null
subreddit_iduuidreferences subreddits.id
is_activebooleannot null

Indexes (2)

  • (subreddit_id, tier)
  • (is_active, tier)

Relationships