What problem does it solve?
Provides guidance and validation rules to design Prisma and PostgreSQL schemas that maintain relational integrity, prevent duplicate or inconsistent records, and improve query performance in production systems.
Core Features & Use Cases
- Constraint Enforcement: Define and validate unique constraints, composite keys, and foreign keys to prevent inconsistent data (e.g., unique(email, organizationId) on Person and unique(personId, eventId) on EventParticipant).
- Soft Delete Conventions: Standardize deletedAt handling across models and highlight anti-patterns such as ignoring soft delete in queries.
- Indexing & Performance: Recommend indexes for frequently queried fields and patterns to avoid full-table scans.
- Use Case: Review and harden the schema for an event-management backend to ensure participant lookups and multi-tenant person records remain correct and performant.
Quick Start
Validate the Prisma schema to enforce composite unique keys for person and event participant, add soft-delete handling, and create indexes for common query fields.