Guides › Database reference › Products and attributes
Magento 2 eav_attribute table
The definition of every attribute of products, categories, customers and addresses: its code, label, input type and which value table holds its data.
Key columns
| Column | What it means |
|---|---|
attribute_id | Attribute ID, used in all the value tables. |
entity_type_id | What it belongs to, linking to eav_entity_type (catalog_product, catalog_category, customer, customer_address). |
attribute_code | The code, such as name, status or color. |
frontend_label | The default label. |
backend_type | Which value table it uses: int, varchar, decimal, text, datetime, or static (a column on the main table). |
frontend_input | The input type: select, multiselect, text, boolean, price and so on. |
is_user_defined | 1 = created in the admin or by an extension, not by Magento core. |
Good to know
- Product-only settings, such as whether an attribute is used as a filter, are in
catalog_eav_attribute.
Example: Your own product attributes (created in the admin or by extensions)
Works on Magento Open Source and Adobe Commerce.
SELECT a.attribute_code, a.frontend_label, a.backend_type, a.frontend_input
FROM eav_attribute a
JOIN eav_entity_type t ON t.entity_type_id = a.entity_type_id AND t.entity_type_code = 'catalog_product'
WHERE a.is_user_defined = 1
ORDER BY a.attribute_code;
Tested on Magento Open Source and Adobe Commerce 2.4.8. Read-only. If your tables have a prefix, add it to each table name.
This table has the same 17 columns on Magento Open Source and Adobe Commerce.
Foreign keys
entity_type_id→eav_entity_type.entity_type_id
All 17 columns (Magento Open Source)
Show all columns
| Column | Type | Can be empty | Magento's description |
|---|---|---|---|
attribute_id | smallint(5) unsigned | Attribute ID | |
entity_type_id | smallint(5) unsigned | Entity Type ID | |
attribute_code | varchar(255) | Attribute Code | |
attribute_model | varchar(255) | yes | Attribute Model |
backend_model | varchar(255) | yes | Backend Model |
backend_type | varchar(8) | Backend Type | |
backend_table | varchar(255) | yes | Backend Table |
frontend_model | varchar(255) | yes | Frontend Model |
frontend_input | varchar(50) | yes | Frontend Input |
frontend_label | varchar(255) | yes | Frontend Label |
frontend_class | varchar(255) | yes | Frontend Class |
source_model | varchar(255) | yes | Source Model |
is_required | smallint(5) unsigned | Defines Is Required | |
is_user_defined | smallint(5) unsigned | Defines Is User Defined | |
default_value | text | yes | Default Value |
is_unique | smallint(5) unsigned | Defines Is Unique | |
note | varchar(255) | yes | Note |