convex-migration-helper

Plans and executes safe Convex schema and data migrations using the widen-migrate-narrow workflow.

Updated Apr 8, 2026
One-click install
npx skills add https://github.com/Noisemaker111/unofficialmarathon --skill convex-migration-helper-noisemaker111
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: convex-migration-helper
Source: https://github.com/Noisemaker111/unofficialmarathon/tree/main/packages/backend/.crush/skills/convex-migration-helper
Command: npx skills add https://github.com/Noisemaker111/unofficialmarathon --skill convex-migration-helper-noisemaker111

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires @convex-dev/migrations, and includes references (resource) components.

What problem does it solve? Convex rejects deployments when the schema does not match existing data, so breaking changes like adding required fields, changing field types, or splitting tables require a careful multi-deploy strategy. This Skill guides you through the widen-migrate-narrow workflow so existing documents are backfilled correctly without failed deploys or missed data. ## Core Features & Use Cases - Multi-Deploy Migration Planning: Structures breaking changes into widen-schema, migrate-data, and narrow-schema phases with code that handles both old and new formats. - Batched Data Migrations: Uses the @convex-dev/migrations component for cursor-based pagination, dry runs, resume-from-failure, and progress monitoring on large tables. - Zero-Downtime Strategies: Provides dual-write and dual-read patterns so the app keeps serving requests while data is migrated asynchronously. - Use Case: You need to change a boolean isPro field on the teams table into a plan enum. The Skill walks you through adding the optional new field, deploying dual-format code, running a dry-run migration, backfilling existing teams, verifying completion, and deploying the narrowed schema. ## Quick Start Ask the assistant to plan a safe migration for your Convex schema change, describing the current field shape and the target shape so it can produce the widen-migrate-narrow deploy sequence.

Frequently Asked Questions about convex-migration-helper

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I add a required field to an existing Convex table?▼

Add the field as optional first and deploy, then run a migration with @convex-dev/migrations to backfill existing documents, and finally deploy a narrowed schema making the field required. Convex rejects deploys where existing documents lack a required field, so the widen-migrate-narrow sequence is mandatory.

How do I change a field type in Convex without downtime?▼

Create a new field with the target type rather than modifying the existing one, then use dual-write or dual-read strategies during the migration window. Backfill old documents with the migrations component, verify completion, and remove the old field in a final deploy.

Why does my Convex deploy fail after a schema change?▼

Convex validates the schema against data at rest, so deploys fail when existing documents do not match, such as missing a newly required field or holding an old field type. Widen the schema to accept both formats, migrate the data, then narrow the schema.

Can I use .collect() to migrate a Convex table?▼

Only for small tables of a few thousand documents at most, using a single internalMutation. Larger tables hit transaction limits or timeouts, so use the @convex-dev/migrations component which handles batched cursor-based pagination and resume from failure.

How do I test a Convex migration before running it on production data?▼

Run the migration with dryRun set to true, for example npx convex run migrations:runIt '{"dryRun": true}'. This executes one batch and rolls back, letting you validate the migration logic without changing any real documents.

When is a Convex migration not needed?▼

No migration is needed for greenfield schemas with no existing data, adding optional fields without backfilling, adding new empty tables, or adding and removing indexes. These changes deploy directly without the widen-migrate-narrow workflow.