Prisma Schema التصميمer
Why this prompt matters
Schema design mistakes are expensive to fix. This prompt produces migration-ready schemas with proper indexing from the start.
What we use it for
Database design
Prompt
Design a Prisma schema for the following business requirements. Include: proper data types, relations with cascading behavior, unique constraints, indexes for common queries, created/updated timestamps, and enum types where appropriate. Add comments explaining non-obvious design decisions.
Result
```prisma /// Products support multiple pricing tiers and locale-specific content model Product { id String @id @default(cuid()) slug String @unique status Status @default(DRAFT) priceInCents Int /// Store cents to avoid floating-point issues currency String @default("USD") createdAt DateTime @default(now()) updatedAt DateTime @updatedAt
translations ProductTranslation[] variants ProductVariant[]
@@index([status, createdAt(sort: Desc)]) } ```
Schema design mistakes are expensive to fix. This prompt produces migration-ready schemas with proper indexing from the start.
This prompt demonstrates a structured approach to database design, producing consistent, high-quality results that can be iterated upon.