MageSmith

🛒 Magento_Sales · engine innodb

sales_order

Sales Flat Order

Neighbourhood (1-hop foreign-key graph — showing 6 of 16)

flowchart LR
  c["sales_order"]:::center
  n0["customer_entity"]
  click n0 "/schema/table/customer_entity"
  n0 -- customer_id --> c
  n1["store"]
  click n1 "/schema/table/store"
  n1 -- store_id --> c
  n2["sales_order_item"]
  click n2 "/schema/table/sales_order_item"
  c -- order_id --> n2
  n3["sales_shipment"]
  click n3 "/schema/table/sales_shipment"
  c -- order_id --> n3
  n4["sales_creditmemo"]
  click n4 "/schema/table/sales_creditmemo"
  c -- order_id --> n4
  n5["sales_invoice"]
  click n5 "/schema/table/sales_invoice"
  c -- order_id --> n5
  click c "/schema/table/sales_order"
  classDef center fill:#eef2ff,stroke:#6366f1,color:#3730a3,stroke-width:1.5px

Click a node to jump to that table.

Columns (138)

NameTypeNullDefaultComment
gift_message_id int yesGift Message ID
paypal_ipn_customer_notified int yes0Paypal Ipn Customer Notified
entity_id PKint unsignednoEntity ID
state varchar(32) yesState
status varchar(32) yesStatus
coupon_code varchar(255) yesCoupon Code
protect_code varchar(255) yesProtect Code
shipping_description varchar(255) yesShipping Description
is_virtual smallint unsignedyesIs Virtual
store_id smallint unsignedyesStore ID
customer_id int unsignedyesCustomer ID
base_discount_amount decimal yesBase Discount Amount
base_discount_canceled decimal yesBase Discount Canceled
base_discount_invoiced decimal yesBase Discount Invoiced
base_discount_refunded decimal yesBase Discount Refunded
base_grand_total decimal yesBase Grand Total
base_shipping_amount decimal yesBase Shipping Amount
base_shipping_canceled decimal yesBase Shipping Canceled
base_shipping_invoiced decimal yesBase Shipping Invoiced
base_shipping_refunded decimal yesBase Shipping Refunded
base_shipping_tax_amount decimal yesBase Shipping Tax Amount
base_shipping_tax_refunded decimal yesBase Shipping Tax Refunded
base_subtotal decimal yesBase Subtotal
base_subtotal_canceled decimal yesBase Subtotal Canceled
base_subtotal_invoiced decimal yesBase Subtotal Invoiced
base_subtotal_refunded decimal yesBase Subtotal Refunded
base_tax_amount decimal yesBase Tax Amount
base_tax_canceled decimal yesBase Tax Canceled
base_tax_invoiced decimal yesBase Tax Invoiced
base_tax_refunded decimal yesBase Tax Refunded
base_to_global_rate decimal yesBase To Global Rate
base_to_order_rate decimal yesBase To Order Rate
base_total_canceled decimal yesBase Total Canceled
base_total_invoiced decimal yesBase Total Invoiced
base_total_invoiced_cost decimal yesBase Total Invoiced Cost
base_total_offline_refunded decimal yesBase Total Offline Refunded
base_total_online_refunded decimal yesBase Total Online Refunded
base_total_paid decimal yesBase Total Paid
base_total_qty_ordered decimal yesBase Total Qty Ordered
base_total_refunded decimal yesBase Total Refunded
discount_amount decimal yesDiscount Amount
discount_canceled decimal yesDiscount Canceled
discount_invoiced decimal yesDiscount Invoiced
discount_refunded decimal yesDiscount Refunded
grand_total decimal yesGrand Total
shipping_amount decimal yesShipping Amount
shipping_canceled decimal yesShipping Canceled
shipping_invoiced decimal yesShipping Invoiced
shipping_refunded decimal yesShipping Refunded
shipping_tax_amount decimal yesShipping Tax Amount
shipping_tax_refunded decimal yesShipping Tax Refunded
store_to_base_rate decimal yesStore To Base Rate
store_to_order_rate decimal yesStore To Order Rate
subtotal decimal yesSubtotal
subtotal_canceled decimal yesSubtotal Canceled
subtotal_invoiced decimal yesSubtotal Invoiced
subtotal_refunded decimal yesSubtotal Refunded
tax_amount decimal yesTax Amount
tax_canceled decimal yesTax Canceled
tax_invoiced decimal yesTax Invoiced
tax_refunded decimal yesTax Refunded
total_canceled decimal yesTotal Canceled
total_invoiced decimal yesTotal Invoiced
total_offline_refunded decimal yesTotal Offline Refunded
total_online_refunded decimal yesTotal Online Refunded
total_paid decimal yesTotal Paid
total_qty_ordered decimal yesTotal Qty Ordered
total_refunded decimal yesTotal Refunded
can_ship_partially smallint unsignedyesCan Ship Partially
can_ship_partially_item smallint unsignedyesCan Ship Partially Item
customer_is_guest smallint unsignedyesCustomer Is Guest
customer_note_notify smallint unsignedyesCustomer Note Notify
billing_address_id int yesBilling Address ID
customer_group_id int yes
edit_increment int yesEdit Increment
email_sent smallint yesEmail Sent
send_email smallint unsignedyesSend Email
forced_shipment_with_invoice smallint unsignedyesForced Do Shipment With Invoice
payment_auth_expiration int yesPayment Authorization Expiration
quote_address_id int yesQuote Address ID
quote_id int yesQuote ID
shipping_address_id int yesShipping Address ID
adjustment_negative decimal yesAdjustment Negative
adjustment_positive decimal yesAdjustment Positive
base_adjustment_negative decimal yesBase Adjustment Negative
base_adjustment_positive decimal yesBase Adjustment Positive
base_shipping_discount_amount decimal yesBase Shipping Discount Amount
base_subtotal_incl_tax decimal yesBase Subtotal Incl Tax
base_total_due decimal yesBase Total Due
payment_authorization_amount decimal yesPayment Authorization Amount
shipping_discount_amount decimal yesShipping Discount Amount
subtotal_incl_tax decimal yesSubtotal Incl Tax
total_due decimal yesTotal Due
weight decimal yesWeight
customer_dob datetime yesCustomer Dob
increment_id varchar(50) yesIncrement ID
applied_rule_ids varchar(128) yesApplied Rule Ids
base_currency_code varchar(3) yesBase Currency Code
customer_email varchar(128) yesCustomer Email
customer_firstname varchar(128) yesCustomer Firstname
customer_lastname varchar(128) yesCustomer Lastname
customer_middlename varchar(128) yesCustomer Middlename
customer_prefix varchar(32) yesCustomer Prefix
customer_suffix varchar(32) yesCustomer Suffix
customer_taxvat varchar(32) yesCustomer Taxvat
discount_description varchar(255) yesDiscount Description
ext_customer_id varchar(32) yesExt Customer ID
ext_order_id varchar(32) yesExt Order ID
global_currency_code varchar(3) yesGlobal Currency Code
hold_before_state varchar(32) yesHold Before State
hold_before_status varchar(32) yesHold Before Status
order_currency_code varchar(3) yesOrder Currency Code
original_increment_id varchar(50) yesOriginal Increment ID
relation_child_id varchar(32) yesRelation Child ID
relation_child_real_id varchar(32) yesRelation Child Real ID
relation_parent_id varchar(32) yesRelation Parent ID
relation_parent_real_id varchar(32) yesRelation Parent Real ID
remote_ip varchar(45) yesRemote Ip
shipping_method varchar(120) yes
store_currency_code varchar(3) yesStore Currency Code
store_name varchar(255) yesStore Name
x_forwarded_for varchar(255) yesX Forwarded For
customer_note text yesCustomer Note
created_at timestamp noCURRENT_TIMESTAMPCreated At
updated_at timestamp noCURRENT_TIMESTAMPUpdated At
total_item_count smallint unsignedno0Total Item Count
customer_gender int yesCustomer Gender
discount_tax_compensation_amount decimal yesDiscount Tax Compensation Amount
base_discount_tax_compensation_amount decimal yesBase Discount Tax Compensation Amount
shipping_discount_tax_compensation_amount decimal yesShipping Discount Tax Compensation Amount
base_shipping_discount_tax_compensation_amnt decimal yesBase Shipping Discount Tax Compensation Amount
discount_tax_compensation_invoiced decimal yesDiscount Tax Compensation Invoiced
base_discount_tax_compensation_invoiced decimal yesBase Discount Tax Compensation Invoiced
discount_tax_compensation_refunded decimal yesDiscount Tax Compensation Refunded
base_discount_tax_compensation_refunded decimal yesBase Discount Tax Compensation Refunded
shipping_incl_tax decimal yesShipping Incl Tax
base_shipping_incl_tax decimal yesBase Shipping Incl Tax
coupon_rule_name varchar(255) yesCoupon Sales Rule Name

Keys & indexes

Primary key: entity_id

Unique

  • SALES_ORDER_INCREMENT_ID_STORE_ID (increment_id, store_id)

Indexes

  • SALES_ORDER_STATUS (status) btree
  • SALES_ORDER_STATE (state) btree
  • SALES_ORDER_STORE_ID (store_id) btree
  • SALES_ORDER_CREATED_AT (created_at) btree
  • SALES_ORDER_CUSTOMER_ID (customer_id) btree
  • SALES_ORDER_EXT_ORDER_ID (ext_order_id) btree
  • SALES_ORDER_QUOTE_ID (quote_id) btree
  • SALES_ORDER_UPDATED_AT (updated_at) btree
  • SALES_ORDER_SEND_EMAIL (send_email) btree
  • SALES_ORDER_EMAIL_SENT (email_sent) btree
  • SALES_ORDER_STORE_STATE_CREATED (store_id, state, created_at) btree

References (2)

  • customer_id customer_entity .entity_id (on delete SET NULL)
  • store_id store .store_id (on delete SET NULL)

Referenced by (14)