-
released this
2025-09-30 09:43:26 -04:00 | 405 commits to main since this releaseSummary
- Fixes migration 008 failing with "column contains null values" error
- Adds COALESCE protection to handle 126 servers without status fields
- Includes test utilities to reproduce and verify fixes with production
data
Problem
Migration 008 was failing in production because:
- 126 out of 781 servers have no
statusfield in their JSON - When extracting
rec.value->>'status', these became NULL values - The
ALTER TABLE servers ALTER COLUMN status SET NOT NULLconstraint
then failed
Solution
- Prevent NULLs during migration: Use COALESCE to provide 'active'
default when status is NULL/empty - Enhanced debugging: Added RAISE NOTICE statements to log
problematic values - Safety check: Double-check that throws exception if any NULLs
remain - Test utilities: Created mirror_data tools to test migrations with
real production data
Testing
Created and used
scripts/mirror_data/tools to:- Fetch all 781 servers from production API
- Load them into a test database
- Verify the migration fix works correctly
Results:
- Before fix: 126 NULL status values created during migration
- After fix: 0 NULL status values, all servers have valid status
- Migration completes successfully with NOT NULL constraint
Test plan
- Tested locally with production data using mirror_data tools
- Verified 0 NULL values after migration (vs 126 before)
- Confirmed NOT NULL constraint adds successfully
- Deploy to staging and verify migration succeeds
- Monitor production deployment
🤖 Generated with Claude Code
Co-authored-by: Claude noreply@anthropic.com
Downloads
-
Source code (ZIP)
0 downloads
-
Source code (TAR.GZ)
0 downloads