What problem does it solve?
This Skill addresses the complexities of designing, evolving, and maintaining robust database schemas, particularly within the context of modern web applications using Prisma and PostgreSQL. It helps prevent common pitfalls related to data integrity, performance, and migration safety.
Core Features & Use Cases
- Schema Design Patterns: Provides best practices for defining models, relations (1:1, 1:N, N:M), indexes, and constraints.
- Migration Strategies: Details safe, zero-downtime migration techniques like "expand/contract" and rollback planning.
- Data Consistency: Explains patterns for transactions, optimistic locking, and idempotency.
- Performance Optimization: Guides on preventing N+1 queries and strategic indexing.
- Use Case: You need to add a new, non-nullable field to an existing
User table in production without causing downtime. This Skill will guide you through the "expand/contract" pattern to achieve this safely.
Quick Start
Describe your database schema problem, focusing on relations, indexes, normalization, zero-downtime migration, consistency, performance, or evolution.