What problem does it solve? Building and maintaining a Prisma/PostgreSQL database layer involves recurring pitfalls: N+1 queries, unsafe migrations that cause downtime, missing indexes, connection leaks in serverless environments, and inconsistent multi-tenant data isolation. This Skill provides production-tested patterns for schema design, query optimization, migrations, and tenant isolation so these mistakes are avoided from the start. ## Core Features & Use Cases - Schema Design for Multi-Tenant SaaS: Model templates with tenant-scoped unique constraints, audit fields, soft-delete, self-referencing relations, and explicit many-to-many join tables. - Query Optimization: N+1 detection and prevention with include/select, composite index ordering rules, partial and GIN indexes via raw SQL, and slow-query logging extensions. - Zero-Downtime Migrations: Expand-contract patterns, CREATE INDEX CONCURRENTLY, and clear lists of dangerous operations to avoid in production. - Use Case: When adding a new Orders feature to a multi-tenant store, the Skill reads the existing schema, follows its ID and indexing conventions, adds tenant-scoped models with proper relations, and generates a safe migration. ## Quick Start Ask the assistant to review your prisma/schema.prisma and add a new tenant-scoped model with proper indexes and a safe migration.