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)

Columns of the order_items table
ColumnTypeConstraintsDescription
iduuidprimary key
order_iduuidnot null, references orders.id
skuvarchar(60)not null
descriptionvarchar(200)not null
quantityintegernot null
unit_amount_minorintegernot null

Indexes (1)

  • (order_id)

Relationships