Commit 4ecaf44
committed
fix: handle NULL status values in migration 008
Fixes production deployment crash where migration 008 fails with:
"column status of relation servers contains null values"
Problem:
- Migration was extracting status from wrong location
- Old format has status at TOP LEVEL of JSON, not in official metadata
- 9 servers have explicit "status": null in their JSON
- Migration incorrectly tried to extract from official_meta->>'status' (always NULL)
- This would cause ALL servers to have NULL status, failing NOT NULL constraint
Solution:
- Extract status from TOP LEVEL JSON (rec.value->>'status') for all records
- Use NULLIF to convert string 'null' to SQL NULL, then COALESCE to 'active'
- Ensures all status values are non-NULL before constraint is added
Affected servers with null status:
- com.biodnd/agent-ip
- io.github.jkakar/cookwith-mcp
- com.joelverhagen.mcp/Knapcode.SampleMcpServer
- io.github.Lyellr88/marm-mcp-server
- com.biodnd/agent-press
- io.github.timheuer/sampledotnetmcpserver
- io.github.CodeCraftersLLC/local-voice-mcp
- com.biodnd/agent-fin
- io.github.ruvnet/ruv-swarm1 parent a0bc09d commit 4ecaf44
File tree
1 file changed
+3
-2
lines changed- internal/database/migrations
1 file changed
+3
-2
lines changedLines changed: 3 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
35 | 35 | | |
36 | 36 | | |
37 | 37 | | |
| 38 | + | |
38 | 39 | | |
39 | 40 | | |
40 | | - | |
| 41 | + | |
41 | 42 | | |
42 | 43 | | |
43 | 44 | | |
| |||
46 | 47 | | |
47 | 48 | | |
48 | 49 | | |
49 | | - | |
| 50 | + | |
50 | 51 | | |
51 | 52 | | |
52 | 53 | | |
| |||
0 commit comments