Step 1 of 5
Model the data
List entities, fields, and relationships before writing SQL.
Design my Supabase data model. I will describe the app below. Produce: each table with columns (correct Postgres types, uuid primary keys with defaults, created_at timestamptz defaults), foreign key relationships with on-delete behavior, unique constraints, and which tables are user-owned (need a user_id referencing auth.users). Explain each relationship choice in one line. MY APP: [describe here]
Expected after this step
A complete table/column/relationship design with ownership marked.
Should not happen
- ✕RLS left off 'for now' and shipped that way
- ✕Policies that allow everything (USING true) on private data
- ✕Missing foreign keys causing orphaned rows
- ✕Types chosen wrong (text for timestamps, no uuid defaults)
Verify before continuing
Do not move on until every check is true. The complete button stays locked until then.
Do not continue if…
- !RLS left off 'for now' and shipped that way
- !Policies that allow everything (USING true) on private data
- !Missing foreign keys causing orphaned rows
- !Types chosen wrong (text for timestamps, no uuid defaults)
If the AI messes this up
Use this when the AI fakes progress or breaks the feature. It forces a real fix.
The model lacks foreign keys or ownership columns. Add explicit references with on-delete rules and a user_id on every user-owned table.