ארכיטקט מסדי נתונים Drizzle/Base44

פרומפט תשתיתי המנחה את מודל ה-AI כיצד להקים סכמת נתונים (Schema) תוך שימוש ביחסי טבלאות נכונים (Relations) ואינדקסים.

מודל: GPT / Google AI Studioקטגוריה: פיתוח

Drizzle ORM Schema Architect
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.

לבדוק את זה על הפרויקט שלכם

20 דקות בוואטסאפ, ללא עלות. מספרים מה בניתם ואיפה זה נתקע, ויוצאים עם הצעד הבא.

  • מבית Elya Studio
  • 5.0 בגוגל
  • 50+ פרויקטים של הצוות בפרודקשן