Goal
Design a Supabase-friendly schema that works with auth, RLS, and migration-based development.
When to Use
- The app will use Supabase Postgres.
- Core entities and permissions are known enough to model.
- The team wants schema guidance before migrations are written.
Instructions
- Define entities, tenant boundaries, and user ownership rules.
- Design tables, enums, relationships, and lifecycle fields.
- Note where
auth.usersjoins, profile tables, and membership tables are needed. - Plan migration order and indexes.
- Flag RLS-sensitive tables for follow-up policy design.
Constraints
- Prefer explicit join tables and memberships over magic JSON blobs.
- Do not rely on dashboard-only manual schema edits.
- Keep auth and app data linked deliberately.
Output Format
- Schema overview
- Table sketches
- Relationship notes
- Migration notes
- RLS follow-ups
Examples
- "Design a Supabase schema for a team-based analytics app."
- "What tables do we need for subscriptions and AI usage history?"