sales_order

Magento2 sales erd

Tables (25)

creditmemo

  • entity_id (creditmemo_id) — int(10) — Primary key — NOT NULL — Entity Id
  • order_id — int(10) — Foreign key → order.entity_id — NOT NULL — Order Id

creditmemo_comment

  • entity_id (creditmemo_comment_id) — int(10) — Primary key — NOT NULL — Entity Id
  • parent_id (creditmemo_id) — int(10) — Foreign key → creditmemo.entity_id — NOT NULL — Parent Id

creditmemo_item

  • entity_id (creditmemo_item_id) — int(10) — Primary key — NOT NULL — Entity Id
  • parent_id (creditmemo_id) — int(10) — Foreign key → creditmemo.entity_id — NOT NULL — Parent Id

invoice_item

  • entity_id (invoice_item_id) — int(10) — Primary key — NOT NULL — Entity Id
  • parent_id — int(10) — Foreign key → sales_invoice.entity_id — NOT NULL — Parent Id

order

  • entity_id (order_id) — int(10) — Primary key — NOT NULL — Entity Id

order_address

  • entity_id (address_id) — int(10) — Primary key — NOT NULL — Entity Id
  • parent_id — int(10) — Foreign key → order.entity_id — Parent Id

order_item

  • item_id — int(10) — Primary key — NOT NULL — Item Id
  • order_id — int(10) — Foreign key → order.entity_id — NOT NULL — Order Id
  • sku — varchar(255) — Sku

order_payment

  • entity_id (order_payment_id) — int(10) — Primary key — NOT NULL — Entity Id
  • parent_id — int(10) — Foreign key → order.entity_id — NOT NULL — Parent Id

order_status

  • status — varchar(32) — Primary key — NOT NULL — Status
  • label — varchar(128) — NOT NULL — Label

order_status_history

  • entity_id (order_status_id) — int(10) — Primary key — NOT NULL — Entity Id
  • parent_id (order_id) — int(10) — Foreign key → order.entity_id — NOT NULL — Parent Id

order_status_label

  • status — varchar(32) — Foreign key → order_status.status — NOT NULL — Status
  • label — varchar(128) — NOT NULL — Label

order_tax

  • tax_id — int(10) — Primary key — NOT NULL — Tax Id
  • order_id — int(10) — NOT NULL — Order Id

payment_transaction

  • transaction_id — int(10) — Primary key — NOT NULL — Transaction Id
  • order_id — int(10) — Foreign key → order.entity_id — NOT NULL — Order Id
  • payment_id — int(10) — Foreign key → order_payment.entity_id — NOT NULL — Payment Id

sales_invoice

  • entity_id (invoice_id) — int(10) — Primary key — NOT NULL — Entity Id
  • order_id — int(10) — Foreign key → order.entity_id — NOT NULL — Order Id

salesrule

  • rule_id — int(10) — Primary key — NOT NULL — Rule Id

salesrule_coupon

  • coupon_id — int(10) — Primary key — NOT NULL — Coupon Id
  • rule_id — int(10) — Foreign key → salesrule.rule_id — NOT NULL — Rule Id

salesrule_coupon_usage

  • coupon_id — int(10) — Foreign key → salesrule_coupon.coupon_id — NOT NULL — Coupon Id
  • times_used — int(10) — NOT NULL — Times Used

salesrule_customer

  • rule_customer_id — int(10) — Primary key — NOT NULL — Rule Customer Id
  • rule_id — int(10) — Foreign key → salesrule.rule_id — NOT NULL — Rule Id
  • times_used — smallint(5) — NOT NULL — Times Used

salesrule_customer_group

  • rule_id — int(10) — Foreign key → salesrule.rule_id — NOT NULL — Rule Id

salesrule_label

  • label_id — int(10) — Primary key — NOT NULL — Label Id
  • rule_id — int(10) — Foreign key → salesrule.rule_id — NOT NULL — Rule Id
  • label — varchar(255) — Label

shipment

  • entity_id (shipment_id) — int(10) — Primary key — NOT NULL — Entity Id
  • order_id — int(10) — Foreign key → order.entity_id — NOT NULL — Order Id

shipment_comment

  • entity_id (shipment_comment_id) — int(10) — Primary key — NOT NULL — Entity Id
  • parent_id (shipment_id) — int(10) — Foreign key → shipment.entity_id — NOT NULL — Parent Id

shipment_item

  • entity_id (shipment_item_id) — int(10) — Primary key — NOT NULL — Entity Id
  • parent_id (shipment_id) — int(10) — Foreign key → shipment.entity_id — NOT NULL — Parent Id
  • sku — varchar(255) — Sku

shipment_track

  • entity_id (shipment_track_id) — int(10) — Primary key — NOT NULL — Entity Id
  • parent_id (shipment_id) — int(10) — Foreign key → shipment.entity_id — NOT NULL — Parent Id
  • order_id — int(10) — NOT NULL — Order Id

tax_item

  • tax_item_id — int(10) — Primary key — NOT NULL — Tax Item Id
  • tax_id — int(10) — Foreign key → order_tax.tax_id — NOT NULL — Tax Id
  • item_id — int(10) — Foreign key → order_item.item_id — Item Id