📦 Magento_Catalog · engine innodb
catalog_category_product
Catalog Product To Category Linkage Table
Neighbourhood (1-hop foreign-key graph — showing 2 of 2)
flowchart LR c["catalog_category_product"]:::center n0["catalog_product_entity"] click n0 "/schema/table/catalog_product_entity" n0 -- product_id --> c n1["catalog_category_entity"] click n1 "/schema/table/catalog_category_entity" n1 -- category_id --> c click c "/schema/table/catalog_category_product" classDef center fill:#eef2ff,stroke:#6366f1,color:#3730a3,stroke-width:1.5px
Click a node to jump to that table.
Related tables (2)
Columns (4)
| Name | Type | Null | Default | Comment |
|---|---|---|---|---|
| entity_id PK | int | no | Entity ID | |
| category_id | int unsigned | no | 0 | Category ID |
| product_id | int unsigned | no | 0 | Product ID |
| position | int | no | 0 | Position |
Keys & indexes
Primary key: entity_id, category_id, product_id
Unique
- CATALOG_CATEGORY_PRODUCT_CATEGORY_ID_PRODUCT_ID (category_id, product_id)
Indexes
- CATALOG_CATEGORY_PRODUCT_PRODUCT_ID (product_id) btree
- CATALOG_CATEGORY_PRODUCT_CATEGORY_ID_PRODUCT_ID_POSITION (category_id, product_id, position) btree
References (2)
- product_id → catalog_product_entity .entity_id (on delete CASCADE)
- category_id → catalog_category_entity .entity_id (on delete CASCADE)