Entity customer
A registered buyer.
Terms: Customer
Subject areas: Sales
Attributes
| # | Name | Type | Null | Default | Key | Terms | Description |
|---|---|---|---|---|---|---|---|
| 1 | id | bigint | no | PK | |||
| 2 | domain email (text(320)) | no | UQ | ||||
| 3 | full_name | text(200) | no | ||||
| 4 | created_at | timestamptz | no | expr "now()" |
Keys
| Kind | Name | Attributes |
|---|---|---|
| primary | pk_customer | id |
| unique | uq_customer_email |
Relationships
| Name | Role | Other entity | Cardinality | Attributes | Identifying | On delete | On update |
|---|---|---|---|---|---|---|---|
| address_customer | parent | address | one to many | address.customer_id -> customer.id | no | cascade | no_action |
| order_customer | parent | order | one to many | order.customer_id -> customer.id | no | restrict | no_action |
Physical
lite (sqlite): main.customer
| # | Name | Type | Null | Default | Identity | Collation | Attribute | Comment |
|---|---|---|---|---|---|---|---|---|
| 1 | id | integer | no | by_default | id | |||
| 2 | text | no | ||||||
| 3 | full_name | text | no | full_name | ||||
| 4 | created_at | text | no | expr "CURRENT_TIMESTAMP" | created_at |
- primary key pk_customer (id)
- unique uq_customer_email (email)
- check ck_customer_email email LIKE '%_@_%'
pg (postgresql): public.customer
A registered buyer.
| # | Name | Type | Null | Default | Identity | Collation | Attribute | Comment |
|---|---|---|---|---|---|---|---|---|
| 1 | id | bigint | no | always | id | |||
| 2 | varchar(320) | no | ||||||
| 3 | full_name | varchar(200) | no | full_name | ||||
| 4 | created_at | timestamp with time zone | no | expr "now()" | created_at |
- primary key pk_customer (id)
- unique uq_customer_email (email)
- check ck_customer_email email ~ '^[^@]+@[^@]+$'