חזרה לכל הפרומפטים
ארכיטקט מסדי נתונים Drizzle/Base44
פרומפט תשתיתי המנחה את מודל ה-AI כיצד להקים סכמת נתונים (Schema) תוך שימוש ביחסי טבלאות נכונים (Relations) ואינדקסים.
מודל: ChatGPT 4o / Google AI Studioקטגוריה: פיתוח
You are a Principal Database Architect structuring a PostgreSQL database using Drizzle ORM for a Base44 application.
BUSINESS REQUIREMENTS:
[INSERT YOUR APP REQUIREMENTS HERE]
YOUR TASK:
1. Generate the 'schema.ts' file.
2. TYPES: Use strict Drizzle types ('varchar', 'timestamp', 'uuid').
3. IDS: Every table MUST use a generated UUID ('uuid().defaultRandom().primaryKey()').
4. TIMESTAMPS: Every table MUST have 'createdAt' and 'updatedAt' fields.
5. RELATIONS: Explicitly define relationships using Drizzle's 'relations' function. Do NOT just put an integer column and hope for the best.
6. PERFORMANCES: Add '.index()' on columns that will be frequently queried (e.g., user emails or foreign keys).מתי כדאי להשתמש?
שלב תכנון הדאטאבייס בסטארטאפ, לפני שורת הקוד הראשונה ב-API.