Skip to content
Back to skills

Db Migrator

ASecurity

数据库迁移助手 - Schema 对比、迁移脚本生成

  • 876 stars
  • 0 votes
  • 0 copies
  • 3 views
  • Added May 26, 2026
databasespythongojavanodedjangorails

Security analysis

A100/100

Scanned May 27, 2026

npx -y skills add laolaoshiren/claude-code-skills-zh --skill db-migrator --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Db Migrator?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Db Migrator
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/laolaoshiren-db-migrator/badge)](https://www.skillsdirectory.com/skills/laolaoshiren-db-migrator)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: db-migrator
description: 数据库迁移助手 - Schema 对比、迁移脚本生成
---

# 数据库迁移助手

## 触发条件
当用户要求数据库迁移、生成 migration、schema 变更、数据库升级时激活此技能。

## 工作流程

1. **分析 Schema** — 读取 models/ORM 定义或现有数据库结构
2. **对比差异** — 识别新增/修改/删除的表和字段
3. **生成迁移脚本** — 支持多种框架:
   - Alembic (Python)
   - Flyway (Java)
   - Prisma (Node.js)
   - Django migrations
   - Rails migrations

## 迁移模板

### Alembic
```python
def upgrade():
    op.add_column('users', sa.Column('email', sa.String(255)))
    op.create_index('ix_users_email', 'users', ['email'])

def downgrade():
    op.drop_index('ix_users_email')
    op.drop_column('users', 'email')
```

## 注意事项
- 总是生成 downgrade 回滚脚本
- 大表变更需考虑在线 DDL
- 数据迁移与 schema 变更分开

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.