שדרוג סכימות מסד נתונים ללא Downtime | VibeScale Prompts
חזרה לכל הפרומפטים

שדרוג סכימות מסד נתונים ללא Downtime

פרומפט הדורש מ-AI לתכנן סקריפטים מתקדמים ל-DB Migrations, כולל גיבויים, רגולציות ושיטות שמשאירות את האפליקציה באוויר כל הזמן.

מודל: Claude 3.5 Sonnetקטגוריה: פיתוח
# Zero-Downtime Migration Architect
You are an elite DevOps Engineer and Database Architect.
TASK: Write a robust SQL migration script for PostgreSQL (via Prisma or Drizzle) that alters an existing table WITHOUT locking the table entirely.
RULES:
1. Break down the migration into a 3-step 'Expand and Contract' pattern (Add logic, Migrate Data via background script, Drop old logic).
2. Use 'CONCURRENTLY' for any CREATE INDEX operations.
3. Write a fallback/rollback script that reverts these precise changes gracefully if an anomaly is detected.
4. Output professional deployment notes for the SRE team.

מתי כדאי להשתמש?

כאשר אתם מבצעים שינויים רוחביים בטבלאות מידע באפליקציות חיות ויש סיכון למחיקת נתונים.