Step 05 of 9 45 min· intermediate
Step 5: Design the Database Schema
Generate the schema and initial migrations from your domain model.
Recommended prompts
Use one of these to do the work in your IDE
Open the template to read it in full. Click Copy prompt to grab it (with your stack values pre-filled where they apply) — then paste into Claude Code, Cursor, or wherever you build.
When you're done
Verify these in your own work before moving on
This is a checklist for you to mentally tick off in your repo and IDE — the site doesn't track it, you do.
- Schema covers every entity mentioned in the PRD
- Foreign keys are explicit and indexed
- Migration file numbered and named (e.g. 0001_init.sql)
- Seed script for local development in your repo
Common pitfalls
What goes wrong at this step
- Forgetting to index foreign keys — every join gets slow
- Using FLOAT for money instead of NUMERIC / DECIMAL
- TEXT everywhere — use the right CHAR / VARCHAR / ENUM constraints up front