---
id: gh-migration
name: "migration"
url: https://skills.yangsir.net/skill/gh-migration
author: juliusbrussee
domain: ai-backend-engineering
tags: ["migration", "rollback", "compatibility", "schema", "data"]
install_count: 14800
rating: 4.50 (120 reviews)
github: https://github.com/juliusbrussee/caveman/tree/main/skills/migration
---

# migration

> 此技能用于实施可逆且兼容性安全的转换，适用于数据库 schema、数据、API、协议、配置或依赖迁移。它确保每次变更都有明确的前进路径和回滚路径，保留现有数据，让破坏性步骤可验证、可审计。在混合版本运行期间保持安全，支持先扩展、迁移、验证、再收缩的流程。该技能帮助团队降低迁移风险，提升发布信心。

**Stats**: 14,800 installs · 4.5/5 (120 reviews)

## Before / After 对比

### 数据库迁移的效率与安全对比

**Before**:

没有这个技能时，开发者需要手动编写迁移脚本，逐个处理兼容性，容易遗漏回滚路径，导致线上故障。一次简单的 schema 迁移往往需要 4 小时，且每次变更都提心吊胆，回滚失败率高达 30%。

**After**:

使用此技能后，迁移过程自动生成前进/回滚路径，并验证兼容窗口。一次 schema 迁移仅需 30 分钟完成，回滚失败率降至 5%，团队可以放心地推进变更，发布信心显著提升。

| Metric | Before | After | Change |
|---|---|---|---|
| 迁移耗时 | 240分钟 | 30分钟 | -87.5% |
| 回滚失败率 | 30% | 5% | -83.33% |

## Readme

# Migration

Map current readers, writers, data shape, compatibility window, and ownership before editing.

- Define forward path and rollback path.
- Preserve existing data; make destructive steps explicit and separately authorized.
- Keep mixed-version operation safe where rollout can overlap.
- Sequence expand, migrate, verify, then contract when applicable.
- Make retries idempotent and partial failure observable.
- Verify old and new paths at required transition stages.

Stop after requested stage passes; do not perform later destructive contraction implicitly.


---
*Source: https://skills.yangsir.net/skill/gh-migration*
*Markdown mirror: https://skills.yangsir.net/api/skill/gh-migration/markdown*