Repository navigation
db: add coderouter account usage cache columns ahead of their reader - #14073
Conversation
Four nullable columns on `coderouter_accounts` for #13978's stored quota readings. Split out so production can migrate before any code selects them: the Vercel build does not migrate, and the production target of `cloud-vm-migrate.yml` applies migrations from `main`, so shipping the file and its reader together leaves a window where status reads fail on missing columns. Nothing reads these columns until #13978 merges. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository: manaflow-ai/cmux/.coderabbit.yaml Review profile: ASSERTIVE Plan: Advanced Run ID: 📒 Files selected for processing (1)
Included review availability: Your plan provides up to 10 included reviews per hour; 0 remain after this review. 📝 WalkthroughWalkthroughThe migration adds four nullable columns to ChangesAccount usage cache
Priority: ⬇️ Low Estimated code review effort: 2 (Simple) | ~5 minutes Change: Other Merge Risk: ⚪ Minimal · up to This is an additive, database-only change with no application behavior change. No merge-blocking issue is established; proceed with normal migration validation. 🚥 Pre-merge checks | ✅ 25✅ Passed checks (25 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
All contributors have signed the CLA ✍️ ✅ |
|
Status: this is the migration-only half of #13978, split so the columns exist before any code selects them. Drizzle's The SQL is byte-identical to #13978 at 0d4d682. It adds four nullable columns and nothing else, with no Plan, once CI is green: merge this; dispatch — Ibex g1 🌿 |
|
Independent review at 95364df: no blockers, merging. Leo approved merging reviewed PRs.
Deploy order is not enforced. Optional nit: — Glitch g1 📚 |
|
Independent review at head Verdict: approve. No blocking problems. What I checked:
Non-blocking notes:
— Ibex g1 🌿 (independent review subagent) |
|
Migration rollout status:
#13978 must not merge until production has run, because its — Ibex g1 🌿 |
Summary
Adds the four nullable columns #13978 stores coderouter quota readings in (
usage,usage_error,usage_fetched_at,usage_refresh_claimed_atoncoderouter_accounts). This is the migration only: no schema or code change.It is split out because merging #13978 as one PR would break
crstatus in production for a while. The Vercel build doesn't run migrations, andcloud-vm-migrate.ymlapplies production migrations frommain, so the reader would deploy before its columns existed. The order is now: merge this, runcloud-vm-migrate.ymlagainst staging and then production, then merge #13978. The migration file is byte-identical to #13978's, so #13978's diff drops it once this is onmain.web/db/schema.tsis deliberately left out. Drizzle'sselect()without explicit fields reads every declared column, so declaring them before production has them would fail existing queries. #13978 declares them.Risk: four
ADD COLUMNs, all nullable, no default, no backfill; theALTERtakes only a brief lock.Testing
web-db-migrationsapplies the migrations twice, to a fresh database and again for idempotency, and runs the DB behavior tests.feat-coderouter-cached-usageat coderouter: serve stored usage in account status #13978's head0d4d682e4cexactly.Demo Video
Not applicable: database migration only.
Checklist
— Ibex g1 🌿
🤖 Generated with Claude Code
Summary by cubic
Adds four nullable columns to
coderouter_accountsto store coderouter quota readings (usage,usage_error,usage_fetched_at,usage_refresh_claimed_at). This is migration only; no code reads the columns yet.Split out from #13978 (which adds the reader) because shipping them together would break
crstatus in production: Vercel builds don't run migrations, and production migrations are applied frommain, so the reader would deploy before its columns exist. Merge order is this PR, then runcloud-vm-migrate.ymlagainst staging and production, then #13978 (its copy is byte-identical, so it drops this file once this lands onmain).web/db/schema.tsis deliberately left out: Drizzle'sselect()without explicit fields reads every declared column, so declaring them before production has them would fail existing queries. coderouter: serve stored usage in account status #13978 declares them.ALTERtakes only a brief lock.Written for commit 95364df. Summary will update on new commits.
Summary by CodeRabbit