🛑 The Problem
When we invent a better algorithm for Health Scores (v0.2), we cannot simply drop the v0.1 data from the database. If we do, the live dashboard will crash for all users until the Inngest workers finish recalculating millions of rows (which could take hours). We need a zero-downtime strategy.
💡 The Solution
Implement the 'Expand and Contract' database migration pattern.
🛠️ Implementation Details
- Expand: Add a new column
health_score_v2 to the schema. Deploy this harmless change.
- Migrate Data: Run a background script that calculates the v0.2 score for all repos and saves it to the new column.
- Switch Reads: Update the frontend Next.js code to read from
health_score_v2. Deploy.
- Contract: Write a final Drizzle migration to drop the old
health_score_v1 column.
✅ Acceptance Criteria
Ready to tackle this? Comment .take below to get automatically assigned!
🛑 The Problem
When we invent a better algorithm for Health Scores (v0.2), we cannot simply drop the v0.1 data from the database. If we do, the live dashboard will crash for all users until the Inngest workers finish recalculating millions of rows (which could take hours). We need a zero-downtime strategy.
💡 The Solution
Implement the 'Expand and Contract' database migration pattern.
🛠️ Implementation Details
health_score_v2to the schema. Deploy this harmless change.health_score_v2. Deploy.health_score_v1column.✅ Acceptance Criteria
Ready to tackle this? Comment
.takebelow to get automatically assigned!