user_avatar_items table
The user_avatar_items table in the Reddit Clone Database Schema schema has 4 columns, with 2 foreign keys to users and avatar_assets.
Ownership and outfit in one row. Uniqueness of the equipped item per slot is enforced by a partial index in the real deployment, not by a column here.
Columns (4)
| Column | Type | Constraints | Description |
|---|---|---|---|
| user_id | uuid | not null, references users.id | |
| asset_id | uuid | not null, references avatar_assets.id | |
| is_equipped | boolean | not null | |
| acquired_at | timestamptz | not null |
Indexes (1)
(user_id, is_equipped)
Relationships
user_avatar_items.user_idreferencesusers.iduser_avatar_items.asset_idreferencesavatar_assets.id