What problem does it solve?
This Skill eliminates hard-to-debug Prisma ORM pitfalls that cause runtime failures and incorrect database behavior, including unsupported partial unique constraints, raw SQL mapped name mismatches, and unhandled P2002 unique constraint violations.
Core Features & Use Cases
- Partial Unique Constraint Guidance: Provides steps to implement conditional unique indexes Prisma's schema DSL does not support, including writing custom migration SQL and handling violations in the service layer.
- Raw SQL Name Correctness: Enforces use of database-mapped @@map/@map table and column names in $queryRaw/$executeRaw queries to avoid "relation does not exist" runtime errors.
- P2002 Error Debugging: Offers clear troubleshooting steps for unique constraint violation errors and relation not found issues when working with Prisma.
- Use Case: When building a multi-tenant application with unique slugs per active tenant, this Skill guides you to create a filtered unique index via custom migration instead of misusing Prisma's unconditional @@unique, and ensures your raw analytics queries reference the correct mapped table names.
Quick Start
Ask the prisma-conventions skill to review your Prisma schema, migrations, and raw SQL queries to catch mapped name mismatches and invalid constraint definitions before they cause runtime errors.