Shop schema

1
differing categories
0
destructive
1
warning
0
safe

Drift

CategoryObjectsSeverity
columns_added1warning
compared 2026-08-30T12:00:00Z

Diagram

customersproductsordersorder_items
Left to right by dependency: a table sits right of everything it references, so this order is one the tables can be created in.

Tables

customers

Customers who can place orders
ColumnTypeNullKeyDefaultReferencesComment
idINTEGERprimary
emailTEXTunique
countryTEXT
IndexColumnsUnique
idx_customers_countrycountry

order_items

Products and quantities attached to an order
ColumnTypeNullKeyDefaultReferencesComment
idINTEGERprimary
order_idINTEGER→ orders(id)
product_idINTEGER→ products(id)
quantityINTEGER1

orders

Orders placed by customers
ColumnTypeNullKeyDefaultReferencesComment
idINTEGERprimary
customer_idINTEGER→ customers(id)
statusTEXTpending
placed_atTEXTnull

products

Products available for ordering
ColumnTypeNullKeyDefaultReferencesComment
idINTEGERprimary
skuTEXTunique
nameTEXT