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)
| Column | Type | Constraints | Description |
|---|---|---|---|
| id | uuid | primary key | |
| order_id | uuid | not null, references orders.id | |
| variant_id | uuid | not null, references product_variants.id | |
| sku | varchar(64) | not null | |
| title | varchar(255) | not null | |
| variant_title | varchar(255) | ||
| quantity | integer | not null | |
| unit_price_cents | integer | not null | |
| discount_cents | integer | not null | |
| tax_cents | integer | not null | |
| total_cents | integer | not null |
Indexes (1)
(order_id)
Relationships
order_lines.order_idreferencesorders.idorder_lines.variant_idreferencesproduct_variants.idshipment_lines.order_line_idreferencesorder_linesreturn_lines.order_line_idreferencesorder_lines