🛒 Magento_Sales · engine innodb
sales_order_item
Sales Flat Order Item
Neighbourhood (1-hop foreign-key graph — showing 4 of 5)
flowchart LR c["sales_order_item"]:::center n0["sales_order"] click n0 "/schema/table/sales_order" n0 -- order_id --> c n1["store"] click n1 "/schema/table/store" n1 -- store_id --> c n2["sales_order_tax_item"] click n2 "/schema/table/sales_order_tax_item" c -- associated_item_id --> n2 n3["downloadable_link_purchased_item"] click n3 "/schema/table/downloadable_link_purchased_item" c -- order_item_id --> n3 click c "/schema/table/sales_order_item" classDef center fill:#eef2ff,stroke:#6366f1,color:#3730a3,stroke-width:1.5px
Click a node to jump to that table.
Related tables (5)
Columns (80)
| Name | Type | Null | Default | Comment |
|---|---|---|---|---|
| gift_message_id | int | yes | Gift Message ID | |
| gift_message_available | int | yes | Gift Message Available | |
| free_shipping | smallint unsigned | no | 0 | Free Shipping |
| item_id PK | int unsigned | no | Item ID | |
| order_id | int unsigned | no | 0 | Order ID |
| parent_item_id | int unsigned | yes | Parent Item ID | |
| quote_item_id | int unsigned | yes | Quote Item ID | |
| store_id | smallint unsigned | yes | Store ID | |
| created_at | timestamp | no | CURRENT_TIMESTAMP | Created At |
| updated_at | timestamp | no | CURRENT_TIMESTAMP | Updated At |
| product_id | int unsigned | yes | Product ID | |
| product_type | varchar(255) | yes | Product Type | |
| product_options | longtext | yes | Product Options | |
| weight | decimal | yes | 0 | Weight |
| is_virtual | smallint unsigned | yes | Is Virtual | |
| sku | varchar(255) | yes | Sku | |
| name | varchar(255) | yes | Name | |
| description | text | yes | Description | |
| applied_rule_ids | text | yes | Applied Rule Ids | |
| additional_data | text | yes | Additional Data | |
| is_qty_decimal | smallint unsigned | yes | Is Qty Decimal | |
| no_discount | smallint unsigned | no | 0 | No Discount |
| qty_backordered | decimal | yes | 0 | Qty Backordered |
| qty_canceled | decimal | yes | 0 | Qty Canceled |
| qty_invoiced | decimal | yes | 0 | Qty Invoiced |
| qty_ordered | decimal | yes | 0 | Qty Ordered |
| qty_refunded | decimal | yes | 0 | Qty Refunded |
| qty_shipped | decimal | yes | 0 | Qty Shipped |
| base_cost | decimal | yes | 0 | Base Cost |
| price | decimal | no | 0 | Price |
| base_price | decimal | no | 0 | Base Price |
| original_price | decimal | yes | Original Price | |
| base_original_price | decimal | yes | Base Original Price | |
| tax_percent | decimal | yes | 0 | Tax Percent |
| tax_amount | decimal | yes | 0 | Tax Amount |
| base_tax_amount | decimal | yes | 0 | Base Tax Amount |
| tax_invoiced | decimal | yes | 0 | Tax Invoiced |
| base_tax_invoiced | decimal | yes | 0 | Base Tax Invoiced |
| discount_percent | decimal | yes | 0 | Discount Percent |
| discount_amount | decimal | yes | 0 | Discount Amount |
| base_discount_amount | decimal | yes | 0 | Base Discount Amount |
| discount_invoiced | decimal | yes | 0 | Discount Invoiced |
| base_discount_invoiced | decimal | yes | 0 | Base Discount Invoiced |
| amount_refunded | decimal | yes | 0 | Amount Refunded |
| base_amount_refunded | decimal | yes | 0 | Base Amount Refunded |
| row_total | decimal | no | 0 | Row Total |
| base_row_total | decimal | no | 0 | Base Row Total |
| row_invoiced | decimal | no | 0 | Row Invoiced |
| base_row_invoiced | decimal | no | 0 | Base Row Invoiced |
| row_weight | decimal | yes | 0 | Row Weight |
| base_tax_before_discount | decimal | yes | Base Tax Before Discount | |
| tax_before_discount | decimal | yes | Tax Before Discount | |
| ext_order_item_id | varchar(255) | yes | Ext Order Item ID | |
| locked_do_invoice | smallint unsigned | yes | Locked Do Invoice | |
| locked_do_ship | smallint unsigned | yes | Locked Do Ship | |
| price_incl_tax | decimal | yes | Price Incl Tax | |
| base_price_incl_tax | decimal | yes | Base Price Incl Tax | |
| row_total_incl_tax | decimal | yes | Row Total Incl Tax | |
| base_row_total_incl_tax | decimal | yes | Base Row Total Incl Tax | |
| discount_tax_compensation_amount | decimal | yes | Discount Tax Compensation Amount | |
| base_discount_tax_compensation_amount | decimal | yes | Base Discount Tax Compensation Amount | |
| discount_tax_compensation_invoiced | decimal | yes | Discount Tax Compensation Invoiced | |
| base_discount_tax_compensation_invoiced | decimal | yes | Base Discount Tax Compensation Invoiced | |
| discount_tax_compensation_refunded | decimal | yes | Discount Tax Compensation Refunded | |
| base_discount_tax_compensation_refunded | decimal | yes | Base Discount Tax Compensation Refunded | |
| tax_canceled | decimal | yes | Tax Canceled | |
| discount_tax_compensation_canceled | decimal | yes | Discount Tax Compensation Canceled | |
| tax_refunded | decimal | yes | Tax Refunded | |
| base_tax_refunded | decimal | yes | Base Tax Refunded | |
| discount_refunded | decimal | yes | Discount Refunded | |
| base_discount_refunded | decimal | yes | Base Discount Refunded | |
| weee_tax_applied | text | yes | Weee Tax Applied | |
| weee_tax_applied_amount | decimal | yes | Weee Tax Applied Amount | |
| weee_tax_applied_row_amount | decimal | yes | Weee Tax Applied Row Amount | |
| weee_tax_disposition | decimal | yes | Weee Tax Disposition | |
| weee_tax_row_disposition | decimal | yes | Weee Tax Row Disposition | |
| base_weee_tax_applied_amount | decimal | yes | Base Weee Tax Applied Amount | |
| base_weee_tax_applied_row_amnt | decimal | yes | Base Weee Tax Applied Row Amnt | |
| base_weee_tax_disposition | decimal | yes | Base Weee Tax Disposition | |
| base_weee_tax_row_disposition | decimal | yes | Base Weee Tax Row Disposition |
Keys & indexes
Primary key: item_id
Indexes
- SALES_ORDER_ITEM_ORDER_ID (order_id) btree
- SALES_ORDER_ITEM_STORE_ID (store_id) btree
References (2)
- order_id → sales_order .entity_id (on delete CASCADE)
- store_id → store .store_id (on delete SET NULL)
Referenced by (3)
- downloadable_link_purchased_item .order_item_id → .item_id (on delete SET NULL)
- sales_order_tax_item .associated_item_id → .item_id (on delete CASCADE)
- sales_order_tax_item .item_id → .item_id (on delete CASCADE)