Skip to content

Convex Schema Migration

Safely change a live Convex database schema and backfill existing data step by step

Stars
9,546
Licence
MIT
Files
1 file

What it does

This skill guides an AI agent through changing the structure of a database for a deployed Convex app without breaking existing records. The agent first makes a new field optional, installs the @convex-dev/migrations library, writes a migration that fills in or transforms old rows, runs it, checks the results, and only then makes the field required. It also reminds the agent to compare row counts before and after the change.

Great for

  • Developers maintaining a live Convex app who need to add or change a required database field
  • Teams that want a cautious, ordered process for schema changes instead of an all-at-once edit

Skip it if

  • Brand-new Convex projects with no existing data, where the staged process adds little value (no existing rows to protect)
  • Apps not built on Convex, since the instructions only cover Convex and its migrations library

Try asking

  • “Add a required 'plan' field to my users table and backfill existing users with 'free'”
  • “Help me migrate our orders schema to split 'address' into street, city and zip, safely on production”
  • “Write a Convex migration that backfills a new slug field for all posts and verify the counts”
Step-by-step guide: how to use Convex Schema MigrationInstall, first run, examples, tips and FAQs

Install in 3 steps

  1. 1

    Download the skill

    The ZIP contains the 1 original files, the MIT licence and an attribution note.

    convex-migrate.zip
  2. 2

    Add it to your agent

    Claude Code (all projects)

    mkdir -p ~/.claude/skills && unzip convex-migrate.zip -d ~/.claude/skills/

    Claude Code / Agent SDK (this project only)

    mkdir -p .claude/skills && unzip convex-migrate.zip -d .claude/skills/

    Claude apps (web/desktop): Settings → Capabilities → Skills → Upload skill, and choose the ZIP.

  3. 3

    Ask for the task

    No special command needed — the agent reads the skill's description and loads it when your request matches. Try one of the prompts above.

Get better results

  • Review every migration the agent writes before running it against production, especially any that modify or delete data
  • Test the migration on a development deployment first and compare row counts there
  • Keep the optional-then-required order: only ask the agent to tighten the validator after the backfill has been verified

What's inside

  • SKILL.md

Redistributed unmodified from openclaw/clawhub under the MIT licence. The assessment was drafted with AI from the skill's files on 2026-10-29. Skills can instruct your agent to run code — read SKILL.md and any scripts before installing.