Design a database schema for my idea

By VibeCoderHQ|Published on 7/8/2025
PromptingAISaas

Get a solid data model before you write a single query, which is far cheaper than fixing it after launch. Works in any AI tool but shines in Claude Code and Cursor where the SQL can be applied directly. The request for a relationship diagram and gotcha list catches design mistakes early, and the Supabase RLS ask saves a common security oversight.

Prompt Text

Act as a senior database designer. I am building [DESCRIBE YOUR APP IN 2 TO 3 SENTENCES]. My database is [Postgres / Supabase / MySQL / SQLite].

The main things the app tracks are: [LIST THE NOUNS, e.g. users, projects, tasks, comments, teams].

Design the schema. For each table give me:
- The columns with their types, and which are required.
- Primary keys and foreign keys, and how the tables relate (one-to-many, many-to-many, and any join tables).
- Sensible defaults, unique constraints, and indexes on the columns I will filter or join on most.
- created_at and updated_at timestamps on every table.

Then:
1. Show the relationships as a simple text diagram so I can sanity-check them.
2. Flag any decision that could bite me later (for example, storing money as cents not floats, soft deletes vs hard deletes, or where a many-to-many is hiding).
3. Give me the full SQL migration to create it. If I am on Supabase, also give me Row Level Security policies so a user can only read and write their own rows.

Ask me up to 3 clarifying questions first if anything about the relationships is unclear.

Join the vibe coder community

Weekly prompts, tools, and success stories to help you build and monetize with AI.

Unsubscribe any time.

Reviews

No reviews yet. Be the first to review!

Leave a Review