convex avatar

Convex Migrate

If you've ever shipped a Convex schema change and watched deploys fail because existing rows didn't match the new validator, this skill is for you. It walks the safe sequence: make the new field optional, install @convex-dev/migrations, write a backfill that fixes old rows, run it, check counts, and only then make the field required. The rule it enforces that matters most is never tightening a validator before the backfill finishes, since that rejects live data. It's a plain workflow with no magic, so the value is mostly in not skipping steps under pressure. Worth installing if you're touching a schema that already has production data.

skills.sh installs
41.3K
GitHub stars
69
last updated
Oct 26, 2026

Install

$ npx -y skills add convex/agent-skills --skill convex-migrate --agent claude-code

Installs into .claude/skills of the current project.

Files

Migrate the schema / data on a live app

Change a deployed schema without breaking existing data: stage the schema change, install @convex-dev/migrations, write a backfill that makes old rows valid, run it, and verify before tightening the validator.

Workflow

  1. Make the new field optional first (so deploy doesn't reject existing rows).
  2. Install @convex-dev/migrations; write a migration that backfills/transforms existing rows.
  3. Run the migration; verify all rows are valid.
  4. Tighten the validator (make the field required) once the backfill is complete.

Rules

  • Never tighten a validator before the backfill completes — it rejects existing rows and breaks the live app.
  • Add new fields as optional first, migrate, then require.
  • Verify row counts before and after.

Sponsors

Details

Repository
github.com/convex/agent-skills
Categories
AI & Agent Building, Databases
First seen
Oct 26, 2026

More from convex/agent-skills

All 30
1convex avatarconvex-reviewerconvex/agent-skillsConvex code reviewer — security, auth, validators, performance, and pattern checks for code in a convex/ directory. Use to review or audit Convex functions befo41.3Kskills.sh installs
2convex avatarconvex-docsconvex/agent-skillsPull version-current Convex docs for the version this project uses — pin the installed version, fetch page-as-markdown or check node_modules types, freshness hi41.3Kskills.sh installs
3convex avatarconvex-envconvex/agent-skillsSet and wire Convex deployment env vars / secrets for the app.41.2Kskills.sh installs
4convex avatarconvex-optimizeconvex/agent-skillsAudit and optimize an existing Convex app: security, scale, upgrades, observability.41.2Kskills.sh installs
5convex avatarconvex-cronsconvex/agent-skillsAdd recurring scheduled jobs (crons) to the Convex app.41.2Kskills.sh installs
6convex avatarconvex-testconvex/agent-skillsGenerate convex-test tests for the app's Convex functions.41.1Kskills.sh installs