fix(migration): 0045 guards json_each against scalar tagger_predictions #93

Merged
bvandeusen merged 1 commits from dev into main 2026-06-10 20:33:27 -04:00
Owner

Hotfix for the steps-1+2 deploy: migration 0045's backfill hit cannot deconstruct a scalar because some image_record rows store tagger_predictions as a JSON scalar/null, not an object — json_each throws on those, rolling back the whole migration (image_prediction never created; web crash-looped on the boot migration).

Guard the backfill with json_typeof = 'object' in a MATERIALIZED CTE so the type filter runs before json_each ever evaluates a scalar.

CI green on dev a712cef (run 849).

🤖 Generated with Claude Code

Hotfix for the steps-1+2 deploy: migration 0045's backfill hit `cannot deconstruct a scalar` because some `image_record` rows store `tagger_predictions` as a JSON scalar/null, not an object — `json_each` throws on those, rolling back the whole migration (image_prediction never created; web crash-looped on the boot migration). Guard the backfill with `json_typeof = 'object'` in a MATERIALIZED CTE so the type filter runs before `json_each` ever evaluates a scalar. CI green on dev `a712cef` (run 849). 🤖 Generated with [Claude Code](https://claude.com/claude-code)
bvandeusen added 1 commit 2026-06-10 20:33:18 -04:00
fix(migration): 0045 backfill guards json_each against non-object rows
CI / lint (push) Successful in 3s
CI / frontend-build (push) Successful in 22s
CI / backend-lint-and-test (push) Successful in 36s
CI / integration (push) Successful in 3m17s
a712cef92d
Some image_record rows store tagger_predictions as a JSON scalar/null rather
than an object; json_each throws 'cannot deconstruct a scalar' on those,
rolling back the whole migration. Filter to json_typeof = 'object' in a
MATERIALIZED CTE so the guard runs before json_each ever evaluates a scalar.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
bvandeusen merged commit 26c68b0a75 into main 2026-06-10 20:33:27 -04:00
Sign in to join this conversation.
No Reviewers
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: bvandeusen/FabledCurator#93