order_lines table

The order_lines table in the E-commerce Database Schema schema has 11 columns, keyed by id, with 2 foreign keys to orders and product_variants. 2 columns in shipment_lines and return_lines reference it.

sku and title are copied, not joined. A renamed product must not change what an old invoice says was bought.

Columns (11)

Columns of the order_lines table
ColumnTypeConstraintsDescription
iduuidprimary key
order_iduuidnot null, references orders.id
variant_iduuidnot null, references product_variants.id
skuvarchar(64)not null
titlevarchar(255)not null
variant_titlevarchar(255)
quantityintegernot null
unit_price_centsintegernot null
discount_centsintegernot null
tax_centsintegernot null
total_centsintegernot null

Indexes (1)

  • (order_id)

Relationships