categories table
The categories table in the E-commerce Database Schema schema has 5 columns, keyed by id, with 1 foreign key to categories. 1 column in product_categories references it.
Self-referencing tree. parent_id null means a top-level department.
Columns (5)
| Column | Type | Constraints | Description |
|---|---|---|---|
| id | uuid | primary key | |
| parent_id | uuid | references categories.id | |
| name | varchar(120) | not null | |
| slug | varchar(140) | unique, not null | |
| position | integer | not null |
Relationships
categories.parent_idreferencescategories.idproduct_categories.category_idreferencescategories