convex-migrations

Manage Convex schema migrations with field additions, backfilling, and zero-downtime patterns.

Updated Aug 30, 2025
One-click install
npx skills add https://github.com/kristofferaas/deep-stortinget --skill convex-migrations-kristofferaas
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: convex-migrations
Source: https://github.com/kristofferaas/deep-stortinget/tree/main/.agents/skills/convex-migrations
Command: npx skills add https://github.com/kristofferaas/deep-stortinget --skill convex-migrations-kristofferaas

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) components.

What problem does it solve?

This Skill provides strategies and patterns for safely evolving your Convex database schema, ensuring data integrity and minimizing downtime during application updates.

Core Features & Use Cases

  • Schema Evolution: Safely add, remove, or rename fields in your Convex database tables.
  • Data Backfilling: Implement strategies to populate new fields with existing data.
  • Zero-Downtime Migrations: Understand patterns for deploying schema changes without interrupting service.
  • Index Management: Learn how to add and utilize indexes for efficient querying.
  • Use Case: You need to add a new avatarUrl field to your users table. This Skill guides you through making the field optional, backfilling existing users with default avatars, and then making the field required.

Quick Start

Use the convex-migrations skill to add an optional avatarUrl field to the users table in your Convex schema.

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 required field to a Convex database without downtime?

You can backfill existing records in Convex by writing internal mutations that iterate through your tables and populate the new fields with default values before enforcing schema requirements.

What is the best way to handle schema evolution and remove deprecated fields in Convex?

Schema evolution in Convex is handled safely by incrementally updating your schema definition to add or rename fields, backfilling data via internal mutations, and removing deprecated fields once application code no longer relies on them.

Can I rename fields in a Convex schema without breaking running queries?

Renaming fields in a Convex schema requires a zero-downtime migration pattern, typically involving adding the new field, backfilling it from the old field's data, updating application queries, and then removing the deprecated field.

Does Convex support zero-downtime migrations for backfilling large datasets?

Yes, Convex supports zero-downtime migrations by utilizing its schema definition and internal mutation system, allowing you to safely backfill large datasets incrementally without interrupting active application service.

When do I need to manage indexes during a Convex schema migration?

You need to manage indexes during a Convex schema migration when adding new fields that will be used for efficient querying, ensuring the database can look up backfilled data without performance degradation.