Agent Skills
› ajanraj/OpenChat
› convex-migrate
convex-migrate
GitHub指导在 Convex 应用中安全迁移 Schema 并回填数据。流程包括:先使新字段可选,安装迁移工具,编写并执行回填脚本验证数据,最后收紧校验器,确保不破坏线上应用。
触发场景
需要修改已部署应用的数据库 Schema
需要对现有数据进行批量更新或转换
安装
npx skills add ajanraj/OpenChat --skill convex-migrate -g -y
SKILL.md
Frontmatter
{
"name": "convex-migrate",
"description": "Migrate schema + backfill data on a deployed Convex app using @convex-dev\/migrations."
}
Migrate the schema / data on a live app
Change a deployed schema without breaking existing data: stage the schema change, install @convex-dev/migrations, write a backfill that makes old rows valid, run it, and verify before tightening the validator.
Workflow
- Make the new field optional first (so deploy doesn't reject existing rows).
- Install @convex-dev/migrations; write a migration that backfills/transforms existing rows.
- Run the migration; verify all rows are valid.
- Tighten the validator (make the field required) once the backfill is complete.
Rules
- Never tighten a validator before the backfill completes — it rejects existing rows and breaks the live app.
- Add new fields as optional first, migrate, then require.
- Verify row counts before and after.
版本历史
- 55de5cd 当前 2026-10-19 22:54


