Database schema · Diagram Design
Commerce schema · public + billing
Commerce schema · public + billing
Physical database schema diagram showing five commerce tables with column-level foreign keys, SQL types, and constraint chips, including a cascading delete from orders into order_items and a billing schema group.
BILLING
ON DELETE RESTRICT
ON DELETE CASCADE
ON DELETE RESTRICT
ON DELETE RESTRICT
public.customers
TABLE
id
PK
uuid
email
UQ
NN
text
created_at
NN
timestamptz
public.orders
TABLE
id
PK
uuid
customer_id
FK
NN
uuid
status
NN
text
total
NN
numeric(12,2)
placed_at
NN
timestamptz
INDEXES
idx_orders_customer_id
idx_orders_status
public.order_items
TABLE
id
PK
uuid
order_id
FK
NN
uuid
product_id
FK
NN
uuid
qty
NN
integer
unit_price
NN
numeric(12,2)
public.products
TABLE
id
PK
uuid
sku
UQ
NN
text
name
NN
text
price
NN
numeric(12,2)
+ 3 more columns
INDEXES
uq_products_sku
billing.invoices
TABLE
id
PK
uuid
order_id
FK
NN
uuid
issued_at
NN
timestamptz
LEGEND
Table
Schema group
PK
Constraint chip
Foreign key (column to column)
Destructive delete (CASCADE)