Database Schema Review
- Read the schema:
cat prisma/schema.prisma 2>/dev/null \
|| cat schema.sql 2>/dev/null \
|| ls migrations/ | sort | tail -5 | xargs -I{} cat migrations/{}
- Check normalization:
- Data duplicated across tables (denormalization without justification)
- Missing junction tables for many-to-many
- Arrays/JSON where a related table would be better
- Check indexes:
- Foreign keys without indexes (full table scan on joins)
- Columns frequently filtered/sorted without indexes
- Redundant indexes (covered by another)
- Check naming conventions:
- Consistent casing (snake_case vs camelCase)
- Tables plural vs singular (pick one)
- Foreign key naming (
userId vs user_id)
- Check data integrity:
- Nullable columns that shouldn't be
- Missing
NOT NULL constraints
- Missing
UNIQUE constraints where applicable
- Missing
ON DELETE behavior on foreign keys
- Report findings ranked by impact.
Use this skill with your AI agent:
Open on Skill Issue to copy, download, or add to your library.
Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.