ClaudeDatabase design
مصمم مخططات Prisma

لماذا تهم هذه المطالبة
Schema design mistakes are expensive to fix. This prompt produces migration-ready schemas with proper indexing from the start.
فيم نستخدمها
Database design
المطالبة
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.
النتيجة
```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)]) } ```
إن الأخطاء في تصميم المخططات مكلفة الإصلاح. يُنتج هذا الأمر التوجيهي مخططات جاهزة للترحيل مع فهرسة صحيحة منذ البداية.
يُظهر هذا الأمر التوجيهي نهجاً منظّماً لتصميم قواعد البيانات، ويُنتج نتائج متسقة وعالية الجودة يمكن البناء عليها وتطويرها.