convex-migrate
This skill safely migrates the schema and backfills existing data on a live Convex deployment: it makes new fields optional first so deploys don't reject legacy rows, writes a @convex-dev/migrations backfill, runs it, verifies every row, and only then tightens the validator. It turns a risky "change a field and break production" operation into a reversible four-step workflow for teams that must evolve their schema without downtime or data loss.
npx skills add https://github.com/convex/agent-skills --skill convex-migrateBefore / After Comparison
1 组Developers edit a field directly on a deployed Convex app and mark it required; after deploy the existing rows fail the new validator, production endpoints error out, and the team must roll back and hand-write scripts to patch data row by row.
This skill makes the field optional so the deploy passes, writes a @convex-dev/migrations backfill job, verifies row counts before and after, and only then tightens the validator to required — with zero downtime.
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
- Make the new field optional first (so deploy doesn't reject existing rows).
- Install @convex-dev/migrations; write a migration that backfills/transforms existing rows.
- Run the migration; verify all rows are valid.
- 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.
User Reviews (0)
Write a Review
No reviews yet
Statistics
User Rating
Rate this Skill