db-migrator SKILL.md skillA
db-migrator from laolaoshiren/claude-code-skills-zh is an agent skill: a SKILL.md folder an AI agent loads when a task calls for it.
mdr add laolaoshiren/claude-code-skills-zh/db-migrator@git:20260713.6d2b008Pins git:20260713.6d2b008 in mdr.lock. Pin the fingerprint instead.
- Audit grade
- A, 17 of 17 checks passed
- Kind
- SKILL.md skill
- Repository
- laolaoshiren/claude-code-skills-zh
- Path
skills/db-migrator/SKILL.md- Versions recorded
- 3
- Latest version
- git:20260713.6d2b008, committed Jul 13, 2026
- First version recorded
- Apr 14, 2026
- Size
- 3,862 bytes
- Repository stars
- 869
- License
- MIT
数据库迁移助手 - Schema 对比、迁移脚本生成.
Collected from public GitHub. Every version is saved exactly as it was and never changes. Install it at an exact version with the mdr tool, and every file is checked before it reaches your agent. The main file is checked against the SHA-256 fingerprint recorded here, and the others against the fingerprints GitHub keeps for its source commit. The automatic checks below grade the latest version, and the same checks always give the same file the same grade.
What the file says
# 数据库迁移助手
## 触发条件
当用户要求数据库迁移、生成 migration、schema 变更、数据库升级时激活此技能。
## 工作流程
### 第 1 步:识别框架
扫描项目文件,判断使用的 ORM/迁移框架:
- `alembic.ini` / `alembic/` → Alembic
- `prisma/schema.prisma` → Prisma
- `pom.xml` 含 flyway → Flyway
- `manage.py` + `settings.py` → Django
- `Gemfile` + `db/migrate/` → Rails
### 第 2 步:分析 Schema 变更
- 对比 models 定义与现有迁移历史
- 识别新增/修改/删除的表和字段
- 检测索引、约束、外键变更
### 第 3 步:生成迁移脚本
根据框架生成对应的迁移文件,并同时生成回滚脚本。
### 第 4 步:风险评估
- 大表 DDL 变更(锁表风险)
- 数据迁移需求
- 向后兼容性
## 迁移模板
### Alembic (Python)
```python
"""add email column to users
Revision ID: abc123
"""
from alembic import op
import sqlalchemy as sa
def upgrade():
op.add_column('users', sa.Column('email', sa.String(255), nullable=True))
op.create_index('ix_users_email', 'users', ['email'], unique=True)
def downgrade():
op.drop_index('ix_users_email')
op.drop_column('users', 'email')
```
### Flyway (Java)
```sql
-- V2__add_email_to_users.sql
ALTER TABLE users ADD COLUMN email VARCHAR(255);
CREATE UNIQUE INDEX ix_users_email ON users(email);
-- 回滚脚本 (单独文件 U2__rollback_add_email.sql)
-- 逆向操作
```
### Prisma (Node.js)
```prisma
// schema.prisma 变更
model User {
id Int @id @default(autoincrement())
…Read the whole file at its exact version.
How to install
mdr add laolaoshiren/claude-code-skills-zh/db-migrator@sha256:81a40b4d2bb5df80The line at the top of this page pins the label git:20260713.6d2b008, which is what most people want. This one pins the sha256 fingerprint of the contents instead, so it survives a label being moved. Either way the exact version is written to mdr.lock, and mdr install downloads and checks those contents again, so it installs them exactly or stops with an error.
[](https://markdownregistry.com/a/art_pceigfbjidbznfed)
5 badge image fetches in 30 days. What the badge shows.
Versions
The registry has recorded 3 versions of this file, between Apr 14, 2026 and Jul 13, 2026, about one every 45 days.
| version | committed | commit | size | audit | |
|---|---|---|---|---|---|
| git:20260713.6d2b008 latest | 2026-07-13 | 6d2b008 | 3,862 B | A | view · diff |
| git:20260617.b8acb5f | 2026-06-17 | b8acb5f | 3,525 B | A | view · diff |
| git:20260414.3583839 | 2026-04-14 | 3583839 | 961 B | A | view |
Audit of the latest version
- pass: Frontmatter block present
- pass: Frontmatter declares a name
- pass: Frontmatter declares a description
- pass: Size between 200 bytes and 200 KB (3862 bytes)
- pass: No zero-width or bidi control characters
- pass: No instruction hidden inside an HTML comment
- pass: No link to an exfiltration or paste host
- pass: No credential-shaped string
- pass: No instruction to send local credentials anywhere
- pass: No text hidden with inline styles
- pass: No prompt-injection phrasing
- pass: No curl or wget piped into a shell
- pass: No recursive delete of root, home or parent
- pass: No instruction to read or print local credentials
- pass: No base64 blob over 200 characters
- pass: No link to a raw IP address
- pass: No script tag
Source
laolaoshiren/claude-code-skills-zh · 869 stars · license MIT · pushed 2026-09-22 · branch main
API
GET https://markdownregistry.com/api/v1/artifacts/art_pceigfbjidbznfed GET https://markdownregistry.com/api/v1/resolve?ref=laolaoshiren/claude-code-skills-zh/db-migrator GET https://markdownregistry.com/api/v1/blob/81a40b4d2bb5df80d9383fb86e6ac1cff757aec5a5055225f16fcc77af0ecf87
Your AI assistant does the legwork. You hear about the deals worth your word. Hand yours the standing instructions at modelranch.com and it joins the network that reads files like this one.
Guides: the SKILL.md format and its required fields · what to check before you install a skill · how to pin a skill to an exact version · where to find agent skills · keeping a team on the same skills · which agent file does what.