Database entities

Magento 1 stores customer information in customer, sales, and other database tables.

Customer data

Magento 1 stores customer information in the customer_entity and customer_address_entity tables. Both of these tables have several reference tables that can contain custom customer attributes.

customer_entity and reference tables

The following columns in the customer_entitytable contain customer information:

ColumnData type
emailvarchar(255)

These tables reference customer_entity and can contain custom customer attributes:

TableColumnData type
customer_entity_datetimevaluedatetime
customer_entity_decimalvaluedecimal(12,4)
customer_entity_intvalueint(11)
customer_entity_textvaluetext
customer_entity_varcharvaluevarchar(255)

customer_address_entity and reference tables

The following tables reference customer_address_entity and can contain custom customer attributes:

TableColumnData type
customer_address_entity_datetimevaluedatetime
customer_address_entity_decimalvaluedecimal(12,4)
customer_address_entity_intvalueint(11)
customer_address_entity_textvaluetext
customer_address_entity_varcharvaluevarchar(255)

Order data

The sales_flat_order and related tables contain the customer’s name, billing and shipping addresses, and related information.

sales_flat_order table

The following columns in the sales_order table contain customer information:

ColumnData type
customer_idint(10)
customer_emailvarchar(128)
customer_firstnamevarchar(128)
customer_genderint(11)
customer_lastnamevarchar(128)
customer_middlenamevarchar(128)
customer_prefixvarchar(32)
customer_suffixvarchar(32)
customer_taxvatvarchar(32)
remote_ipvarchar(32)

sales_flat_order_address table

The sales_flat_order_address table contains the customer’s address.

ColumnData type
customer_idint(10)
faxvarchar(255)
regionvarchar(255)
postcodevarchar(255)
lastnamevarchar(255)
streetvarchar(255)
cityvarchar(255)
emailvarchar(255)
telephonevarchar(255)
firstnamevarchar(255)
prefixvarchar(255)
suffixvarchar(255)
middlenamevarchar(255)
companyvarchar(255)
vat_idtext

sales_flat_order_grid table

The following columns in the sales_flat_order_grid table contain customer information:

ColumnData type
customer_idint(10)
shipping_namevarchar(255)
billing_namevarchar(255)

sales_flat_order_payment table

The following columns in the sales_flat_order_payment table contain customer information:

ColumnData type
cc_exp_monthvarchar(255)
cc_ss_start_yearvarchar(255)
echeck_bank_namevarchar(128)
echeck_typevarchar(255)
cc_ss_start_monthvarchar(255)
cc_ownervarchar(255)
cc_exp_yearvarchar(255)
echeck_routing_numbervarchar(255)
echeck_account_namevarchar(255)

Quote data

Quotes contain a customer’s name, email, address, and related information.

sales_flat_quote table

The following columns in the sales_flat_quote table contain customer information:

ColumnData type
customer_idint(10)
customer_tax_class_idint(10)
customer_group_idint(10)
customer_emailvarchar(255)
customer_prefixvarchar(40)
customer_firstnamevarchar(255)
customer_middlenamevarchar(40)
customer_lastnamevarchar(255)
customer_suffixvarchar(40)
customer_dobdatetime
customer_notevarchar(255)
remote_ipvarchar(255)
customer_gendervarchar(255)

sales_flat_quote_address table

The following columns in the sales_flat_quote_address table contain customer information:

ColumnData type
emailvarchar(255)
prefixvarchar(40)
firstnamevarchar(255)
middlenamevarchar(40)
lastnamevarchar(255)
suffixvarchar(40)
companyvarchar(255)
streetvarchar(255)
cityvarchar(255)
regionvarchar(255)
postcodevarchar(255)
faxvarchar(255)

sales_flat_quote_payment table

The sales_flat_quote_payment table includes credit card information and other transactional information.

ColumnData type
cc_last_4varchar(255)
cc_ownervarchar(255)
cc_exp_monthsmallint(5)
cc_exp_yearsmallint(5)
cc_ss_ownervarchar(255)
cc_ss_start_monthsmallint(5)
cc_ss_start_yearsmallint(5)

Archive data

The following tables and columns contain customer information:

TableColumnData type
enterprise_sales_creditmemo_grid_archivebilling_namevarchar(255)
enterprise_sales_invoice_grid_archivebilling_namevarchar(255)
enterprise_sales_order_grid_archivebilling_namevarchar(255)
enterprise_sales_order_grid_archivecustomer_idint(10)
enterprise_sales_order_grid_archiveshipping_namevarchar(255)
enterprise_sales_shipment_grid_archiveshipping_namevarchar(255)

Sales data

The following tables and columns contain customer information:

TableColumnData type
sales_flat_creditmemo_gridbilling_namevarchar(255)
sales_flat_invoice_gridbilling_namevarchar(255)

RMA data

The following RMA tables and columns contain customer information:

TableColumnData type
enterprise_rmacustomer_custom_emailvarchar(255)
enterprise_rma_gridcustomer_idint(10)
enterprise_rma_gridcustomer_namevarchar(255)