convex-migration-helper

Plans and executes Convex schema and data migrations using widen-migrate-narrow workflows.

Updated Jul 26, 2026
One-click install
npx skills add https://github.com/chrissstellee/Movix --skill convex-migration-helper-chrissstellee
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: convex-migration-helper
Source: https://github.com/chrissstellee/Movix/tree/main/.agents/skills/convex-migration-helper
Command: npx skills add https://github.com/chrissstellee/Movix --skill convex-migration-helper-chrissstellee

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 schema changes like adding required fields or renaming columns cannot be shipped directly. This Skill guides the multi-deploy widen-migrate-narrow workflow and the @convex-dev/migrations component so data backfills happen safely without downtime. ## Core Features & Use Cases - Multi-Deploy Migration Planning: Structures breaking changes into widen schema, backfill data, then narrow schema deploys with a complete checklist. - Batched Migration Execution: Uses the @convex-dev/migrations component for cursor-based pagination, dry runs, resume from failure, and status monitoring. - Pattern Library: Provides ready-made patterns for adding required fields, changing field types, splitting nested data into tables, and cleaning orphaned documents. - Use Case: You need to add a required role field to an existing users table in production. The Skill walks you through adding it as optional, backfilling with a dry-run-tested migration, verifying completion, and then making it required. ## Quick Start Help me plan and execute a safe Convex migration for adding a required field to my existing users table, including the backfill and final schema narrowing.

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 backfill existing documents with a migration using @convex-dev/migrations, and finally deploy a schema that makes the field required. Convex rejects deploys where existing documents lack a required field, so the widen-migrate-narrow sequence is mandatory.

How do I run a Convex data migration in production?▼

Define the migration with migrations.define and run it directly from the CLI using npx convex run migrations:myMigration --prod. Test first with dryRun: true, then monitor progress with npx convex run --component migrations lib:getStatus --watch.

When does a Convex schema change not need a migration?▼

Adding optional fields, adding new tables, and adding indexes are safe changes that deploy directly without migrating data. Migrations are only needed for breaking changes like required fields, type changes, renames, or deletions on tables with existing data.

Why does my Convex deploy fail after making a field required?▼

Convex validates the schema against data at rest and rejects the deploy if existing documents lack the required field. Widen the schema to make the field optional, backfill all documents with a migration, then narrow the schema in a later deploy.

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

Only for small tables of a few thousand documents, since .collect() hits transaction limits or timeouts on large tables. For anything larger, use the @convex-dev/migrations component, which handles batched cursor-based pagination and resume from failure.

How do I handle reads and writes during a Convex migration window?▼

Use dual write, where code writes both old and new formats while reading the old format until migration completes, or dual read, where code reads both formats preferring the new one while writing only the new format. Dual write is preferred because rollback stays safe.