Shop schema

0
differing categories
0
destructive
0
warning
0
safe
The database matches the declared schema.
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
idINTEGER—primary
emailTEXT—unique
countryTEXT—
IndexColumnsUnique
idx_customers_countrycountry

order_items

Products and quantities attached to an order
ColumnTypeNullKeyDefaultReferencesComment
idINTEGER—primary
order_idINTEGER—→ orders(id)
product_idINTEGER—→ products(id)
quantityINTEGER—1

orders

Orders placed by customers
ColumnTypeNullKeyDefaultReferencesComment
idINTEGER—primary
customer_idINTEGER—→ customers(id)
statusTEXT—pending
placed_atTEXTnull

products

Products available for ordering
ColumnTypeNullKeyDefaultReferencesComment
idINTEGER—primary
skuTEXT—unique
nameTEXT—