03_DATABASE / D1 Schema Reference
SQL / EdgeD1 Schema Reference
The ShotByHamadi platform utilizes Cloudflare D1 (SQLite) at the edge for ultra-low latency data retrieval. This documentation outlines the core production database schema.
Services
Stores all bookable services displayed on the /services page and managed via the Admin Dashboard.
| Column | Type | Primary Key | Default / Note |
|---|---|---|---|
| id | INTEGER | Yes | AUTOINCREMENT |
| title | TEXT | No | - |
| description | TEXT | No | - |
| price | REAL | No | - |
| features | TEXT | No | [] (JSON Array) |
| category | TEXT | No | - |
| travel_fee | REAL | No | 0 |
| policy_note | TEXT | No | - |
| is_active | INTEGER | No | 1 (Boolean) |
Projects
Stores client project references mapped to R2 buckets, authenticating secure Client Portals.
| Column | Type | Primary Key | Default / Note |
|---|---|---|---|
| id | TEXT | Yes | UUID |
| project_code | TEXT | No | UNIQUE (6-chars) |
| client_name | TEXT | No | - |
| client_email | TEXT | No | - |
| created_at | DATETIME | No | CURRENT_TIMESTAMP |
| folder_path | TEXT | No | R2 Prefix String |
| location | TEXT | No | - |
| project_password | TEXT | No | NULLABLE |
| base_price | REAL | No | 0 |
| travel_surcharge | REAL | No | 0 |
| notes | TEXT | No | NULLABLE |