What problem does it solve?
Safely plan and execute Convex schema and data migrations that would otherwise fail schema validation or risk data inconsistency, enabling multi-deploy widen-migrate-narrow workflows and online backfills with minimal downtime.
Core Features & Use Cases
- Migration workflow guidance: Step-by-step multi-deploy pattern (widen, migrate, narrow) for adding required fields, changing types, splitting or merging tables, and renames.
- Migrations component integration: Use the @convex-dev/migrations component for batched, resumable, cursored migrations with dry-run and status monitoring.
- Safety patterns and pitfalls: Recommendations for dual-write/dual-read strategies, when to use small-table shortcuts, and checks to avoid transaction limits or missed documents.
- Use case: Add a new required role field to an existing users table, backfill existing users with a default role, verify no unmigrated documents remain, and then make the field required.
Quick Start
Plan a widen-migrate-narrow migration: update the schema to accept both formats, deploy code that reads both and writes the new format, define and dry-run a migrations component job to backfill existing documents, run the migration to completion, then narrow the schema and remove legacy handling.