order_items table
The order_items table in the Reddit Clone Database Schema schema has 6 columns, keyed by id, with 1 foreign key to orders.
sku and description are copied rather than joined live, so renaming a coin pack next year cannot rewrite what an old receipt says was bought.
Columns (6)
| Column | Type | Constraints | Description |
|---|---|---|---|
| id | uuid | primary key | |
| order_id | uuid | not null, references orders.id | |
| sku | varchar(60) | not null | |
| description | varchar(200) | not null | |
| quantity | integer | not null | |
| unit_amount_minor | integer | not null |
Indexes (1)
(order_id)
Relationships
order_items.order_idreferencesorders.id