Entity product
Something for sale.
Subject areas: Catalog
Attributes
| # | Name | Type | Null | Default | Key | Terms | Description |
|---|---|---|---|---|---|---|---|
| 1 | id | bigint | no | PK | |||
| 2 | category_id | bigint | no | FK | |||
| 3 | sku | text(40) | no | UQ | |||
| 4 | name | text(200) | no | ||||
| 5 | price | domain money (decimal(12, 2)) | no | 0 | |||
| 6 | attributes | json | yes | ||||
| 7 | active | boolean | no | true |
Keys
| Kind | Name | Attributes |
|---|---|---|
| primary | pk_product | id |
| unique | uq_product_sku | sku |
Relationships
| Name | Role | Other entity | Cardinality | Attributes | Identifying | On delete | On update |
|---|---|---|---|---|---|---|---|
| order_line_product | parent | order_line | one to many | order_line.product_id -> product.id | no | no_action | no_action |
| product_category | child | category | one to many | product.category_id -> category.id | no | no_action | no_action |
Physical
lite (sqlite): main.product
| # | Name | Type | Null | Default | Identity | Collation | Attribute | Comment |
|---|---|---|---|---|---|---|---|---|
| 1 | id | integer | no | by_default | id | |||
| 2 | category_id | integer | no | category_id | ||||
| 3 | sku | text | no | sku | ||||
| 4 | name | text | no | name | ||||
| 5 | price | numeric | no | 0 | price | |||
| 6 | attributes | text | yes | attributes | ||||
| 7 | active | integer | no | 1 | active |
- primary key pk_product (id)
- unique uq_product_sku (sku)
- foreign key fk_product_category (category_id) references category (id)
- index ix_product_category (category_id)
pg (postgresql): public.product
Something for sale.
| # | Name | Type | Null | Default | Identity | Collation | Attribute | Comment |
|---|---|---|---|---|---|---|---|---|
| 1 | id | bigint | no | always | id | |||
| 2 | category_id | bigint | no | category_id | ||||
| 3 | sku | varchar(40) | no | sku | ||||
| 4 | name | varchar(200) | no | name | ||||
| 5 | price | numeric(12, 2) | no | 0 | price | |||
| 6 | attributes | jsonb | yes | attributes | ||||
| 7 | active | boolean | no | true | active |
- primary key pk_product (id)
- unique uq_product_sku (sku)
- foreign key fk_product_category (category_id) references category (id)
- index ix_product_category (category_id)