Simple Magento2-sales MK

Magento2 sales erd

Tables (11)

customer_entity

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

quote

  • entity_id — BIGINT — Primary key — NOT NULL
  • store_id — INT — NOT NULL
  • created_at — TIMESTAMP
  • updated_at — TIMESTAMP
  • converted_at — TIMESTAMP
  • is_active — INT
  • is_virtual — INT
  • is_multi_shipping — INT
  • items_count — BIGINT
  • items_qty — DECIMAL(12,4)
  • orig_order_id — BIGINT
  • store_to_base_rate — DECIMAL(12,4)
  • store_to_quote_rate — DECIMAL(12,4)
  • base_currency_code — VARCHAR(765)
  • store_currency_code — VARCHAR(765)
  • quote_currency_code — VARCHAR(765)
  • grand_total — DECIMAL(12,4)
  • base_grand_total — DECIMAL(12,4)
  • checkout_method — VARCHAR(765)
  • customer_id — BIGINT
  • customer_tax_class_id — BIGINT
  • customer_group_id — BIGINT
  • customer_email — VARCHAR(765)
  • customer_prefix — VARCHAR(120)
  • customer_firstname — VARCHAR(765)
  • customer_middlename — VARCHAR(120)
  • customer_lastname — VARCHAR(765)
  • customer_suffix — VARCHAR(120)
  • customer_dob — TIMESTAMP
  • customer_note_notify — INT
  • customer_is_guest — INT
  • remote_ip — VARCHAR(135)
  • applied_rule_ids — VARCHAR(765)
  • entity_id (reserved_order_id) — VARCHAR(765) — Foreign key → sales_order.entity_id — Entity Id
  • coupon_code — VARCHAR(765)
  • global_currency_code — VARCHAR(765)
  • base_to_global_rate — DECIMAL(12,4)
  • base_to_quote_rate — DECIMAL(12,4)
  • customer_taxvat — VARCHAR(765)
  • customer_gender — VARCHAR(765)
  • subtotal — DECIMAL(12,4)
  • base_subtotal — DECIMAL(12,4)
  • subtotal_with_discount — DECIMAL(12,4)
  • base_subtotal_with_discount — DECIMAL(12,4)
  • is_changed — BIGINT
  • trigger_recollect — SMALLINT — NOT NULL
  • ext_shipping_info — TEXT
  • is_persistent — INT
  • customer_balance_amount_used — DECIMAL(12,4)
  • base_customer_bal_amount_used — DECIMAL(12,4)
  • use_customer_balance — INT
  • gift_cards — TEXT
  • gift_cards_amount — DECIMAL(12,4)
  • base_gift_cards_amount — DECIMAL(12,4)
  • gift_cards_amount_used — DECIMAL(12,4)
  • base_gift_cards_amount_used — DECIMAL(12,4)
  • gift_message_id — INT
  • gw_id — INT
  • gw_allow_gift_receipt — INT
  • gw_add_card — INT
  • … +46

sales_invoice

  • entity_id — int(10) — Primary key — NOT NULL — Entity Id
  • order_id — int(10) — Foreign key → sales_order.entity_id — NOT NULL — Order Id
  • store_id — smallint(5) — Foreign key → store.store_id — Store Id
  • base_grand_total — decimal(12,4) — Base Grand Total
  • shipping_tax_amount — decimal(12,4) — Shipping Tax Amount
  • tax_amount — decimal(12,4) — Tax Amount
  • base_tax_amount — decimal(12,4) — Base Tax Amount
  • store_to_order_rate — decimal(12,4) — Store To Order Rate
  • base_shipping_tax_amount — decimal(12,4) — Base Shipping Tax Amount
  • base_discount_amount — decimal(12,4) — Base Discount Amount
  • base_to_order_rate — decimal(12,4) — Base To Order Rate
  • grand_total — decimal(12,4) — Grand Total
  • shipping_amount — decimal(12,4) — Shipping Amount
  • subtotal_incl_tax — decimal(12,4) — Subtotal Incl Tax
  • base_subtotal_incl_tax — decimal(12,4) — Base Subtotal Incl Tax
  • store_to_base_rate — decimal(12,4) — Store To Base Rate
  • base_shipping_amount — decimal(12,4) — Base Shipping Amount
  • total_qty — decimal(12,4) — Total Qty
  • base_to_global_rate — decimal(12,4) — Base To Global Rate
  • subtotal — decimal(12,4) — Subtotal
  • base_subtotal — decimal(12,4) — Base Subtotal
  • discount_amount — decimal(12,4) — Discount Amount
  • billing_address_id — int(11) — Billing Address Id
  • is_used_for_refund — smallint(5) — Is Used For Refund
  • email_sent — smallint(5) — Email Sent
  • send_email — smallint(5) — Send Email
  • can_void_flag — smallint(5) — Can Void Flag
  • state — int(11) — State
  • shipping_address_id — int(11) — Shipping Address Id
  • store_currency_code — varchar(3) — Store Currency Code
  • transaction_id — varchar(255) — Transaction Id
  • order_currency_code — varchar(3) — Order Currency Code
  • base_currency_code — varchar(3) — Base Currency Code
  • global_currency_code — varchar(3) — Global Currency Code
  • increment_id — varchar(50) — Increment Id
  • created_at — timestamp — NOT NULL — Created At
  • updated_at — timestamp — NOT NULL — Updated At
  • discount_tax_compensation_amount — decimal(12,4) — Discount Tax Compensation Amount
  • base_discount_tax_compensation_amount — decimal(12,4) — Base Discount Tax Compensation Amount
  • shipping_discount_tax_compensation_amount — decimal(12,4) — Shipping Discount Tax Compensation Amount
  • base_shipping_discount_tax_compensation_amnt — decimal(12,4) — Base Shipping Discount Tax Compensation Amount
  • shipping_incl_tax — decimal(12,4) — Shipping Incl Tax
  • base_shipping_incl_tax — decimal(12,4) — Base Shipping Incl Tax
  • base_total_refunded — decimal(12,4) — Base Total Refunded
  • discount_description — varchar(255) — Discount Description
  • customer_note — text — Customer Note
  • customer_note_notify — smallint(5) — Customer Note Notify

sales_invoice_item

  • entity_id — int(10) — Primary key — NOT NULL — Entity Id
  • parent_id — int(10) — Foreign key → sales_invoice.entity_id — NOT NULL — Parent Id
  • base_price — decimal(12,4) — Base Price
  • tax_amount — decimal(12,4) — Tax Amount
  • base_row_total — decimal(12,4) — Base Row Total
  • discount_amount — decimal(12,4) — Discount Amount
  • row_total — decimal(12,4) — Row Total
  • base_discount_amount — decimal(12,4) — Base Discount Amount
  • price_incl_tax — decimal(12,4) — Price Incl Tax
  • base_tax_amount — decimal(12,4) — Base Tax Amount
  • base_price_incl_tax — decimal(12,4) — Base Price Incl Tax
  • qty — decimal(12,4) — Qty
  • base_cost — decimal(12,4) — Base Cost
  • price — decimal(12,4) — Price
  • base_row_total_incl_tax — decimal(12,4) — Base Row Total Incl Tax
  • row_total_incl_tax — decimal(12,4) — Row Total Incl Tax
  • product_id — int(11) — Product Id
  • order_item_id — int(11) — Order Item Id
  • additional_data — text — Additional Data
  • description — text — Description
  • sku — varchar(255) — Sku
  • name — varchar(255) — Name
  • discount_tax_compensation_amount — decimal(12,4) — Discount Tax Compensation Amount
  • base_discount_tax_compensation_amount — decimal(12,4) — Base Discount Tax Compensation Amount
  • tax_ratio — text — Ratio of tax invoiced over tax of the order item
  • weee_tax_applied — text — Weee Tax Applied
  • weee_tax_applied_amount — decimal(12,4) — Weee Tax Applied Amount
  • weee_tax_applied_row_amount — decimal(12,4) — Weee Tax Applied Row Amount
  • weee_tax_disposition — decimal(12,4) — Weee Tax Disposition
  • weee_tax_row_disposition — decimal(12,4) — Weee Tax Row Disposition
  • base_weee_tax_applied_amount — decimal(12,4) — Base Weee Tax Applied Amount
  • base_weee_tax_applied_row_amnt — decimal(12,4) — Base Weee Tax Applied Row Amnt
  • base_weee_tax_disposition — decimal(12,4) — Base Weee Tax Disposition
  • base_weee_tax_row_disposition — decimal(12,4) — Base Weee Tax Row Disposition

sales_order

  • entity_id — int(10) — Primary key — NOT NULL — Entity Id
  • state — varchar(32) — State
  • status — varchar(32) — Status
  • coupon_code — varchar(255) — Coupon Code
  • protect_code — varchar(255) — Protect Code
  • shipping_description — varchar(255) — Shipping Description
  • is_virtual — smallint(5) — Is Virtual
  • store_id — smallint(5) — Foreign key → store.store_id — Store Id
  • customer_id — int(10) — Foreign key → customer_entity.entity_id — Customer Id
  • base_discount_amount — decimal(12,4) — Base Discount Amount
  • base_discount_canceled — decimal(12,4) — Base Discount Canceled
  • base_discount_invoiced — decimal(12,4) — Base Discount Invoiced
  • base_discount_refunded — decimal(12,4) — Base Discount Refunded
  • base_grand_total — decimal(12,4) — Base Grand Total
  • base_shipping_amount — decimal(12,4) — Base Shipping Amount
  • base_shipping_canceled — decimal(12,4) — Base Shipping Canceled
  • base_shipping_invoiced — decimal(12,4) — Base Shipping Invoiced
  • base_shipping_refunded — decimal(12,4) — Base Shipping Refunded
  • base_shipping_tax_amount — decimal(12,4) — Base Shipping Tax Amount
  • base_shipping_tax_refunded — decimal(12,4) — Base Shipping Tax Refunded
  • base_subtotal — decimal(12,4) — Base Subtotal
  • base_subtotal_canceled — decimal(12,4) — Base Subtotal Canceled
  • base_subtotal_invoiced — decimal(12,4) — Base Subtotal Invoiced
  • base_subtotal_refunded — decimal(12,4) — Base Subtotal Refunded
  • base_tax_amount — decimal(12,4) — Base Tax Amount
  • base_tax_canceled — decimal(12,4) — Base Tax Canceled
  • base_tax_invoiced — decimal(12,4) — Base Tax Invoiced
  • base_tax_refunded — decimal(12,4) — Base Tax Refunded
  • base_to_global_rate — decimal(12,4) — Base To Global Rate
  • base_to_order_rate — decimal(12,4) — Base To Order Rate
  • base_total_canceled — decimal(12,4) — Base Total Canceled
  • base_total_invoiced — decimal(12,4) — Base Total Invoiced
  • base_total_invoiced_cost — decimal(12,4) — Base Total Invoiced Cost
  • base_total_offline_refunded — decimal(12,4) — Base Total Offline Refunded
  • base_total_online_refunded — decimal(12,4) — Base Total Online Refunded
  • base_total_paid — decimal(12,4) — Base Total Paid
  • base_total_qty_ordered — decimal(12,4) — Base Total Qty Ordered
  • base_total_refunded — decimal(12,4) — Base Total Refunded
  • discount_amount — decimal(12,4) — Discount Amount
  • discount_canceled — decimal(12,4) — Discount Canceled
  • discount_invoiced — decimal(12,4) — Discount Invoiced
  • discount_refunded — decimal(12,4) — Discount Refunded
  • grand_total — decimal(12,4) — Grand Total
  • shipping_amount — decimal(12,4) — Shipping Amount
  • shipping_canceled — decimal(12,4) — Shipping Canceled
  • shipping_invoiced — decimal(12,4) — Shipping Invoiced
  • shipping_refunded — decimal(12,4) — Shipping Refunded
  • shipping_tax_amount — decimal(12,4) — Shipping Tax Amount
  • shipping_tax_refunded — decimal(12,4) — Shipping Tax Refunded
  • store_to_base_rate — decimal(12,4) — Store To Base Rate
  • store_to_order_rate — decimal(12,4) — Store To Order Rate
  • subtotal — decimal(12,4) — Subtotal
  • subtotal_canceled — decimal(12,4) — Subtotal Canceled
  • subtotal_invoiced — decimal(12,4) — Subtotal Invoiced
  • subtotal_refunded — decimal(12,4) — Subtotal Refunded
  • tax_amount — decimal(12,4) — Tax Amount
  • tax_canceled — decimal(12,4) — Tax Canceled
  • tax_invoiced — decimal(12,4) — Tax Invoiced
  • tax_refunded — decimal(12,4) — Tax Refunded
  • total_canceled — decimal(12,4) — Total Canceled
  • … +78

sales_order_address

  • entity_id — int(10) — Primary key — NOT NULL — Entity Id
  • parent_id — int(10) — Foreign key → sales_order.entity_id — Parent Id
  • customer_address_id — int(11) — Customer Address Id
  • quote_address_id — int(11) — Quote Address Id
  • region_id — int(11) — Region Id
  • customer_id — int(11) — Customer Id
  • fax — varchar(255) — Fax
  • region — varchar(255) — Region
  • postcode — varchar(255) — Postcode
  • lastname — varchar(255) — Lastname
  • street — varchar(255) — Street
  • city — varchar(255) — City
  • email — varchar(255) — Email
  • telephone — varchar(255) — Phone Number
  • country_id — varchar(2) — Country Id
  • firstname — varchar(255) — Firstname
  • address_type — varchar(255) — Address Type
  • prefix — varchar(255) — Prefix
  • middlename — varchar(255) — Middlename
  • suffix — varchar(255) — Suffix
  • company — varchar(255) — Company
  • vat_id — text — Vat Id
  • vat_is_valid — smallint(6) — Vat Is Valid
  • vat_request_id — text — Vat Request Id
  • vat_request_date — text — Vat Request Date
  • vat_request_success — smallint(6) — Vat Request Success

sales_order_item

  • item_id — int(10) — Primary key — NOT NULL — Item Id
  • order_id — int(10) — Foreign key → sales_order.entity_id — NOT NULL — Order Id
  • parent_item_id — int(10) — Parent Item Id
  • quote_item_id — int(10) — Quote Item Id
  • store_id — smallint(5) — Foreign key → store.store_id — Store Id
  • created_at — timestamp — NOT NULL — Created At
  • updated_at — timestamp — NOT NULL — Updated At
  • product_id — int(10) — Product Id
  • product_type — varchar(255) — Product Type
  • product_options — text — Product Options
  • weight — decimal(12,4) — Weight
  • is_virtual — smallint(5) — Is Virtual
  • sku — varchar(255) — Sku
  • name — varchar(255) — Name
  • description — text — Description
  • applied_rule_ids — text — Applied Rule Ids
  • additional_data — text — Additional Data
  • is_qty_decimal — smallint(5) — Is Qty Decimal
  • no_discount — smallint(5) — NOT NULL — No Discount
  • qty_backordered — decimal(12,4) — Qty Backordered
  • qty_canceled — decimal(12,4) — Qty Canceled
  • qty_invoiced — decimal(12,4) — Qty Invoiced
  • qty_ordered — decimal(12,4) — Qty Ordered
  • qty_refunded — decimal(12,4) — Qty Refunded
  • qty_shipped — decimal(12,4) — Qty Shipped
  • base_cost — decimal(12,4) — Base Cost
  • price — decimal(12,4) — NOT NULL — Price
  • base_price — decimal(12,4) — NOT NULL — Base Price
  • original_price — decimal(12,4) — Original Price
  • base_original_price — decimal(12,4) — Base Original Price
  • tax_percent — decimal(12,4) — Tax Percent
  • tax_amount — decimal(12,4) — Tax Amount
  • base_tax_amount — decimal(12,4) — Base Tax Amount
  • tax_invoiced — decimal(12,4) — Tax Invoiced
  • base_tax_invoiced — decimal(12,4) — Base Tax Invoiced
  • discount_percent — decimal(12,4) — Discount Percent
  • discount_amount — decimal(12,4) — Discount Amount
  • base_discount_amount — decimal(12,4) — Base Discount Amount
  • discount_invoiced — decimal(12,4) — Discount Invoiced
  • base_discount_invoiced — decimal(12,4) — Base Discount Invoiced
  • amount_refunded — decimal(12,4) — Amount Refunded
  • base_amount_refunded — decimal(12,4) — Base Amount Refunded
  • row_total — decimal(12,4) — NOT NULL — Row Total
  • base_row_total — decimal(12,4) — NOT NULL — Base Row Total
  • row_invoiced — decimal(12,4) — NOT NULL — Row Invoiced
  • base_row_invoiced — decimal(12,4) — NOT NULL — Base Row Invoiced
  • row_weight — decimal(12,4) — Row Weight
  • base_tax_before_discount — decimal(12,4) — Base Tax Before Discount
  • tax_before_discount — decimal(12,4) — Tax Before Discount
  • ext_order_item_id — varchar(255) — Ext Order Item Id
  • locked_do_invoice — smallint(5) — Locked Do Invoice
  • locked_do_ship — smallint(5) — Locked Do Ship
  • price_incl_tax — decimal(12,4) — Price Incl Tax
  • base_price_incl_tax — decimal(12,4) — Base Price Incl Tax
  • row_total_incl_tax — decimal(12,4) — Row Total Incl Tax
  • base_row_total_incl_tax — decimal(12,4) — Base Row Total Incl Tax
  • discount_tax_compensation_amount — decimal(12,4) — Discount Tax Compensation Amount
  • base_discount_tax_compensation_amount — decimal(12,4) — Base Discount Tax Compensation Amount
  • discount_tax_compensation_invoiced — decimal(12,4) — Discount Tax Compensation Invoiced
  • base_discount_tax_compensation_invoiced — decimal(12,4) — Base Discount Tax Compensation Invoiced
  • … +20

sales_order_payment

  • entity_id — int(10) — Primary key — NOT NULL — Entity Id
  • parent_id — int(10) — Foreign key → sales_order.entity_id — NOT NULL — Parent Id
  • base_shipping_captured — decimal(12,4) — Base Shipping Captured
  • shipping_captured — decimal(12,4) — Shipping Captured
  • amount_refunded — decimal(12,4) — Amount Refunded
  • base_amount_paid — decimal(12,4) — Base Amount Paid
  • amount_canceled — decimal(12,4) — Amount Canceled
  • base_amount_authorized — decimal(12,4) — Base Amount Authorized
  • base_amount_paid_online — decimal(12,4) — Base Amount Paid Online
  • base_amount_refunded_online — decimal(12,4) — Base Amount Refunded Online
  • base_shipping_amount — decimal(12,4) — Base Shipping Amount
  • shipping_amount — decimal(12,4) — Shipping Amount
  • amount_paid — decimal(12,4) — Amount Paid
  • amount_authorized — decimal(12,4) — Amount Authorized
  • base_amount_ordered — decimal(12,4) — Base Amount Ordered
  • base_shipping_refunded — decimal(12,4) — Base Shipping Refunded
  • shipping_refunded — decimal(12,4) — Shipping Refunded
  • base_amount_refunded — decimal(12,4) — Base Amount Refunded
  • amount_ordered — decimal(12,4) — Amount Ordered
  • base_amount_canceled — decimal(12,4) — Base Amount Canceled
  • quote_payment_id — int(11) — Quote Payment Id
  • additional_data — text — Additional Data
  • cc_exp_month — varchar(12) — Cc Exp Month
  • cc_ss_start_year — varchar(12) — Cc Ss Start Year
  • echeck_bank_name — varchar(128) — Echeck Bank Name
  • method — varchar(128) — Method
  • cc_debug_request_body — varchar(32) — Cc Debug Request Body
  • cc_secure_verify — varchar(32) — Cc Secure Verify
  • protection_eligibility — varchar(32) — Protection Eligibility
  • cc_approval — varchar(32) — Cc Approval
  • cc_last_4 — varchar(100) — Cc Last 4
  • cc_status_description — varchar(32) — Cc Status Description
  • echeck_type — varchar(32) — Echeck Type
  • cc_debug_response_serialized — varchar(32) — Cc Debug Response Serialized
  • cc_ss_start_month — varchar(128) — Cc Ss Start Month
  • echeck_account_type — varchar(255) — Echeck Account Type
  • last_trans_id — varchar(32) — Last Trans Id
  • cc_cid_status — varchar(32) — Cc Cid Status
  • cc_owner — varchar(128) — Cc Owner
  • cc_type — varchar(32) — Cc Type
  • po_number — varchar(32) — Po Number
  • cc_exp_year — varchar(4) — Cc Exp Year
  • cc_status — varchar(4) — Cc Status
  • echeck_routing_number — varchar(32) — Echeck Routing Number
  • account_status — varchar(32) — Account Status
  • anet_trans_method — varchar(32) — Anet Trans Method
  • cc_debug_response_body — varchar(32) — Cc Debug Response Body
  • cc_ss_issue — varchar(32) — Cc Ss Issue
  • echeck_account_name — varchar(32) — Echeck Account Name
  • cc_avs_status — varchar(32) — Cc Avs Status
  • cc_number_enc — varchar(128)
  • cc_trans_id — varchar(32) — Cc Trans Id
  • address_status — varchar(32) — Address Status
  • additional_information — text — Additional Information

salesrule

  • rule_id — int(10) — Primary key — NOT NULL — Rule Id
  • name — varchar(255) — Name
  • description — text — Description
  • from_date — date — From
  • to_date — date — To
  • uses_per_customer — int(11) — NOT NULL — Uses Per Customer
  • is_active — smallint(6) — NOT NULL — Is Active
  • conditions_serialized — mediumtext — Conditions Serialized
  • actions_serialized — mediumtext — Actions Serialized
  • stop_rules_processing — smallint(6) — NOT NULL — Stop Rules Processing
  • is_advanced — smallint(5) — NOT NULL — Is Advanced
  • product_ids — text — Product Ids
  • sort_order — int(10) — NOT NULL — Sort Order
  • simple_action — varchar(32) — Simple Action
  • discount_amount — decimal(12,4) — NOT NULL — Discount Amount
  • discount_qty — decimal(12,4) — Discount Qty
  • discount_step — int(10) — NOT NULL — Discount Step
  • apply_to_shipping — smallint(5) — NOT NULL — Apply To Shipping
  • times_used — int(10) — NOT NULL — Times Used
  • is_rss — smallint(6) — NOT NULL — Is Rss
  • coupon_type — smallint(5) — NOT NULL — Coupon Type
  • use_auto_generation — smallint(6) — NOT NULL — Use Auto Generation
  • uses_per_coupon — int(11) — NOT NULL — User Per Coupon
  • simple_free_shipping — smallint(6)

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
  • code — varchar(255) — Code
  • usage_limit — int(10) — Usage Limit
  • usage_per_customer — int(10) — Usage Per Customer
  • times_used — int(10) — NOT NULL — Times Used
  • expiration_date — timestamp — Expiration Date
  • is_primary — smallint(5) — Is Primary
  • created_at — timestamp — Coupon Code Creation Date
  • type — smallint(6) — Coupon Code Type

store

  • store_id — smallint(5) — Primary key — NOT NULL — Store Id