convex-migrations

Manage Convex database schema migrations with optional fields, backfilling, and indexes.

Updated Feb 26, 2026
One-click install
npx skills add https://github.com/kausthubh-coder/studi --skill convex-migrations-kausthubh-coder
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: convex-migrations
Source: https://github.com/kausthubh-coder/studi/tree/main/.agents/skills/convex-migrations
Command: npx skills add https://github.com/kausthubh-coder/studi --skill convex-migrations-kausthubh-coder

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes 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: Implement safe patterns for adding, removing, or renaming fields in your Convex tables.
  • Data Backfilling: Handle the migration of existing data to accommodate schema changes.
  • Index Management: Add and utilize new indexes to optimize query performance.
  • 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

Follow the documentation to add a new optional field to your users table schema.

Frequently Asked Questions about convex-migrations

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

FAQPage Schema
How do I safely add a new required field to an existing Convex database schema?

To add a required field to a Convex database schema, first define it as optional, deploy your changes, run a backfill script to populate existing documents with default values, and finally update the schema to make the field required.

What is the best way to rename a field in Convex without downtime?

Renaming a field in Convex without downtime involves adding the new field name, backfilling data from the old field, updating your application code to use the new field, and then removing the deprecated field in a subsequent deployment.

Can I backfill existing data when migrating a Convex schema?

Yes, you can backfill existing data during a Convex schema migration by writing a script that iterates through your documents and updates them to match the new schema requirements using default or computed values.

How do I add a new index to a Convex table?

You can add a new index to a Convex table by defining the index in your schema file and deploying the change. Convex handles index building in the background, allowing you to optimize query performance without downtime.

Does removing deprecated fields from a Convex schema affect existing data?

Removing deprecated fields from a Convex schema drops that data from your documents. You should ensure all application code no longer references the field and backfill any necessary data before removing it from the schema.