Playbook
0 / 9 complete0%
  1. 01
  2. 02
  3. 03
  4. 04
  5. 05
  6. 06
  7. 07
  8. 08
  9. 09
Step 05 of 9 45 min· intermediate

Step 5: Design the Database Schema

Generate the schema and initial migrations from your domain model.

What you're doing in this step

Lock the data shape before APIs and UI start consuming it. Schema changes later cost 10x what they cost now.

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.

Primary recommendation 20 min

PostgreSQL Schema Designer

Design a normalized PostgreSQL schema with indexes, constraints, and migration files.

postgressql
View template
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
← Previous step

Command Palette

Search for a command to run...