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)
| Column | Type | Constraints | Description |
|---|---|---|---|
| id | uuid | primary key | |
| code | varchar(40) | unique, not null | |
| name | varchar(80) | not null | |
| description | varchar(255) | ||
| tier | award_tier | not null | |
| coin_price | integer | not null | |
| icon_url | varchar(500) | ||
| grants_premium_days | smallint | not null | |
| grants_coins | integer | not null | |
| subreddit_id | uuid | references subreddits.id | |
| is_active | boolean | not null |
Indexes (2)
(subreddit_id, tier)(is_active, tier)
Relationships
awards.subreddit_idreferencessubreddits.idaward_gifts.award_idreferencesawards