convex-migrations

Plan staged Convex database schema migrations with batch backfills and recovery-safe updates.

Updated May 4, 2024
One-click install
npx skills add https://github.com/kcrlee/dots --skill convex-migrations-kcrlee
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: convex-migrations
Source: https://github.com/kcrlee/dots/tree/main/claude/.claude/skills/convex-migrations
Command: npx skills add https://github.com/kcrlee/dots --skill convex-migrations-kcrlee

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill helps you evolve a Convex schema safely as your application changes, preventing broken reads, failed writes, and downtime during deployment.

Core Features & Use Cases

  • Add new fields safely by introducing optional schema fields first, then backfilling existing records in batches.
  • Remove or rename fields carefully by updating application code in stages and cleaning up stored data only after the transition is complete.
  • Handle index and type changes with migration-friendly rollout patterns, progress tracking, and recovery-aware batch processing.
  • Use case: upgrade a production user, posts, or tasks schema while keeping old and new documents readable throughout the migration.

Quick Start

Ask for a Convex migration plan for the schema change you want, including rollout steps, backfill strategy, and any required code updates.

Frequently Asked Questions about convex-migrations

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

FAQPage Schema
How do I add a new field to a Convex schema without downtime?

To add a new field without downtime, introduce it as an optional schema field first, then backfill existing records in batched pages to keep old and new documents readable throughout the migration.

What's the best way to remove or rename fields in a Convex database?

The best way to remove or rename fields safely is to update application code in stages and clean up stored data only after the transition is fully complete, preventing broken reads or failed writes.

How do I backfill existing Convex documents during a schema migration?

You backfill existing Convex documents by using batch pagination with migration tracking and recovery-safe mutations, allowing progress to resume if interrupted without corrupting data.

Can I change field types or migrate indexes in Convex without breaking production reads?

Yes, you can change field types or migrate indexes in Convex without breaking production reads by applying migration-friendly rollout patterns that keep both old and new documents readable throughout the process.

Why does updating a Convex schema directly cause failed writes or downtime?

Updating a Convex schema directly causes failures because existing documents may not match the new required fields or types, breaking reads and writes until a staged, zero-downtime migration is performed.

Do I need to stage schema updates for zero-downtime Convex deployments?

Yes, you need to stage schema updates for zero-downtime Convex deployments to ensure both old and new application code can read documents consistently while backfilling or removing fields.