convex-migrations

Implements schema migration patterns for Convex databases including backfills and field renames.

Updated May 28, 2026
One-click install
npx skills add https://github.com/mrisoli/pokerhouse --skill convex-migrations-mrisoli
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: convex-migrations
Source: https://github.com/mrisoli/pokerhouse/tree/main/.agents/skills/convex-migrations
Command: npx skills add https://github.com/mrisoli/pokerhouse --skill convex-migrations-mrisoli

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Evolving a Convex database schema without breaking existing documents is tricky because Convex has no explicit migration files and does not automatically transform existing data. This Skill provides proven patterns for adding fields, backfilling data, renaming fields, changing types, and managing indexes without downtime. ## Core Features & Use Cases - Safe Field Evolution: Add new fields as optional, backfill in batches with paginated internal mutations, then make them required once data is consistent. - Field Renames and Type Changes: Copy data to new fields with fallback reads, convert types via mapping logic, and remove deprecated fields only after code stops using them. - Migration Runner Pattern: Track migration status in a dedicated table with start, progress, completion, and failure states to prevent duplicate runs. - Use Case: You need to add a required avatarUrl field to an existing users table with thousands of documents. Use this Skill to add it as optional, run a batched backfill mutation scheduled via the Convex scheduler, then tighten the schema. ## Quick Start Use the convex-migrations skill to add a new required field to my users table and backfill existing documents in batches.

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 an existing Convex table?▼

Add the field as optional in the schema, update queries to handle missing values, then run a batched internal mutation to backfill existing documents. After the backfill completes, change the field to required in the schema.

How do I rename a field in a Convex schema?▼

Add the new field as optional, update code to read the new field with a fallback to the old one, backfill by copying values in batches, then remove the old field from the schema once all code uses the new name.

Does Convex support automatic database migrations?▼

Convex has no explicit migration files or commands. Schema changes deploy instantly with npx convex dev, but existing data is not transformed, so you must write backfill mutations using pagination and the scheduler.

Why do Convex backfill mutations time out on large tables?▼

Mutations time out when processing too many documents in one call. Use pagination with small batch sizes around 100 documents and schedule the next batch with ctx.scheduler.runAfter to continue processing.

How do I track which Convex migrations have already run?▼

Create a migrations table storing name, status, and progress for each migration. Check this table before running a migration and mark it completed when finished to prevent duplicate executions.