Schema diagram with editable notes
Tables and relationships from your SQL. Scroll inside the diagram to explore a large schema.
Edit table and column notes below, then save a new copy. Names, columns and relationships stay unchanged.
Editable notes
Open a table to edit its notes. Changes stay in this browser until you save a new copy.
app.customers
People and companies who buy from us.
| Column | Type | Notes |
| id | INTEGER | primary key |
| full_name | VARCHAR | |
| email | TEXT | Unique email address used for login. |
| status | VARCHAR | |
| created_at | TIMESTAMP WITHOUT TIME ZONE | |
app.addresses
| Column | Type | Notes |
| id | INTEGER | primary key |
| customer_id | INTEGER | links to customers |
| line1 | VARCHAR | |
| city | VARCHAR | |
| postal_code | VARCHAR | |
app.categories
| Column | Type | Notes |
| id | INTEGER | primary key |
| name | VARCHAR | |
| parent_category_id | INTEGER | |
app.suppliers
| Column | Type | Notes |
| id | INTEGER | primary key |
| name | VARCHAR | |
| active | BOOLEAN | |
app.products
Items we sell to customers.
| Column | Type | Notes |
| id | INTEGER | primary key |
| sku | VARCHAR | |
| name | VARCHAR | |
| price | NUMERIC | |
| category_id | INTEGER | |
| supplier_id | INTEGER | links to suppliers |
app.orders
| Column | Type | Notes |
| id | INTEGER | primary key |
| customer_id | INTEGER | |
| billing_address_id | INTEGER | links to addresses |
| shipping_address_id | INTEGER | links to addresses |
| order_date | DATE | |
| total_amount | NUMERIC | |
app.order_items
| Column | Type | Notes |
| order_id | INTEGER | primary key |
| product_id | INTEGER | primary key, links to products |
| quantity | INTEGER | |
| unit_price | NUMERIC | |
app.payments
| Column | Type | Notes |
| id | INTEGER | primary key |
| order_id | INTEGER | links to orders |
| amount | NUMERIC | |
| method | VARCHAR | |
| paid_at | TIMESTAMP WITHOUT TIME ZONE | |
app.invoices
| Column | Type | Notes |
| id | INTEGER | primary key |
| order_id | INTEGER | |
| customer_id | INTEGER | |
| issued_at | TIMESTAMP WITHOUT TIME ZONE | |
| total_amount | NUMERIC | |
app.inventory
| Column | Type | Notes |
| id | INTEGER | primary key |
| product_id | INTEGER | links to products |
| warehouse | VARCHAR | |
| quantity_on_hand | INTEGER | |
audit.login_events
| Column | Type | Notes |
| id | INTEGER | primary key |
| customer_id | INTEGER | |
| user_agent | TEXT | Raw browser string, kept only for fraud checks. |
| happened_at | TIMESTAMP WITHOUT TIME ZONE | |
audit.change_log
| Column | Type | Notes |
| id | INTEGER | primary key |
| customer_id | INTEGER | |
| table_name | VARCHAR | |
| changed_at | TIMESTAMP WITHOUT TIME ZONE | |