Agent skill · Audited from source
Db Migrator
skill · laolaoshiren/claude-code-skills-zhMIT licenceAudited 19 Oct 2026 · source 7d69626375c6
Is it safe? Yes — SAFE, grade B (89/100). We read this skill's source at commit 7d69626375c6 and found no filesystem, network or shell access and no hard-coded secrets. What it does: 数据库迁移助手 - Schema 对比、迁移脚本生成
Cite
Cite this page
ModelsAtlas. “Db Migrator (laolaoshiren/claude-code-skills-zh)”. Retrieved 19 Oct 2026. https://modelsatlas.com/skills/laolaoshiren/db-migrator
Trust audit
Audit 0.4.1 · source read 19 Oct 2026
SAFE means nothing in the source contradicts what the skill says it does. Grade B is shared by 13,985 of 14,816 audited skills.
What the source does
- FilesystemNone observedNo reads or writes in the source
- NetworkNone observedNo outbound calls in the source
- ShellNone observedNo commands run in the source
- DependenciesPinnedNothing floats
- SecretsNone foundNo keys in source
Five audit layers
| Layer | What we check | Result | Findings |
|---|---|---|---|
L0 Provenance | Repo owner, licence, archive status, activity | PASS | 0 |
L1 Static source | Secrets, path traversal, supply chain, hidden code | NA | 0 |
L2 Instructions | Prompt injection, authority framing, hidden directives | PASS | 0 |
L3 Inventory | The files and declarations match the source | PASS | 0 |
L4 Sandbox | Run in isolation and watch behaviour | SKIPPED why | 0 |
Gates applied: no behavioural pass.
Findings (0)
No findings at any severity. We re-audit when the source changes.
Audit 0.4.1 · source sha 7d69626375c6 · 19 Oct 2026Report an issue or request a re-scan
Provenance
Who published it, and what the verdict is pinned to
- Publisherlaolaoshiren GitHub userOwner of the repository this skill is read from
- Source folderlaolaoshiren/claude-code-skills-zh/skills/db-migratorThe exact folder we audited
- LicenceMITAs the repository states it
- Commit pinned for this verdict7d69626375c6A new audit runs when the source changes
- Repository statusNot archivedPushed today
- Sandboxed runNot runSkills are read, not executed; layer L4 is skipped
What it tells the agent
Full source on GitHub ↗Its description: 数据库迁移助手 - Schema 对比、迁移脚本生成
---
name: db-migrator
description: 数据库迁移助手 - Schema 对比、迁移脚本生成
---
# 数据库迁移助手
## 触发条件
当用户要求数据库迁移、生成 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())
name String
email String? @unique // 新增字段
}
```
```bash
# 默认仅生成迁移,不执行数据库变更
npx prisma migrate dev --name add-email-to-users --create-only
```
检查生成的 SQL、连接目标和备份后,再由用户确认执行:
```bash
# 开发环境应用迁移
npx prisma migrate dev
# 生产环境应用已审核并提交的迁移
npx prisma migrate deploy
```
### Django (Python)
```python
# users/migrations/0002_add_email.py
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [('users', '0001_initial')]
operations = [
migrations.AddField(
model_name='user',
name='email',
field=models.EmailField(unique=True, null=True),
),
]
```
`unique=True` 已由 Django 生成唯一约束和对应索引,不要再创建重复索引。
### Rails (Ruby)
```ruby
# db/migrate/20260617_add_email_to_users.rb
class AddEmailToUsers < ActiveRecord::Migration[7.0]
def change
add_column :users, :email, :string
add_index :users, :email, unique: true
end
end
```
```bash
rails db:migrate # 执行迁移
rails db:rollback # 回滚上一次
rails db:rollback STEP=3 # 回滚最近 3 次
```
## 回滚策略
| 场景 | 策略 |
|------|------|
| 新增列 | 直接移除该列 |
| 删除列 | 无法自动回滚,需提前备份数据 |
| 修改列类型 | 反向修改为原类型,注意数据丢失风险 |
| 新增表 | 移除该表 |
| 数据迁移 | 编写反向迁移脚本,保留原始数据快照 |
| 大表变更 | 使用在线 DDL 工具避免锁表 |
## 注意事项
- 默认只生成和审查迁移;执行前确认环境、数据库连接、备份和维护窗口
- 框架支持可逆迁移时提供 downgrade;不支持时明确恢复快照或前向修复方案
- 大表变更需考虑在线 DDL,避免长时间锁表
- 数据迁移与 schema 变更分开处理
- 迁移应由框架记录版本并安全重试,不要假设版本迁移可以任意重复执行
- 在 staging 环境验证后再应用到生产环境
- 涉及删除列/表的变更,确保应用代码已先移除相关引用Excerpt, first 2,705 characters of SKILL.md, verbatim from the audited commit. It is text from someone else’s repository, quoted so you can judge it before your agent reads it.
Install
Pinned to the audited commit 7d69626
git clone https://github.com/laolaoshiren/claude-code-skills-zh git -C claude-code-skills-zh checkout 7d69626375c6
The author documents no install command, so this uses the repository directly. Our verdict covers commit 7d69626375c6 only.
Works in
The author has not said which agents this skill supports, and we have not tested it in any.
Audit history
Every audit, every source change
- ✓SAFE B 89 / 100
first audit · source
7d69626375c6
Similar skills
All coding & review skills →laolaoshiren/claude-code-skills-zh
依据真实 OpenAPI、路由实现和现有测试生成并验证 API 测试。用于用户要求测试接口、补集成测试、验证 API 契约、生成回归用例或排查接口兼容性时;区分“生成测试”和“执行请求”的授权,不猜测状态码、响应结构或 SLA,不在未确认环境中发送写请求。
laolaoshiren/claude-code-skills-zh
Changelog 生成器 - 从 Git 历史自动生成 CHANGELOG
laolaoshiren/claude-code-skills-zh
审计 Node.js、Python、Go、Rust、JVM、Ruby 项目的依赖漏洞、版本健康度与许可证事实;当用户要求检查 package.json、lockfile、requirements、go.mod、Cargo.toml、pom.xml、Gemfile.lock,或生成不改依赖的中文审计报告时使用
laolaoshiren/claude-code-skills-zh
项目目录结构地图 - 生成带说明的可视化目录树,快速理解任意代码库
laolaoshiren/claude-code-skills-zh
环境变量管理器:扫描、校验、同步 .env 文件,生成安全配置模板
laolaoshiren/claude-code-skills-zh
编程错误消息翻译专家 — 将英文错误消息翻译成中文,解释原因并提供修复方案
Questions about Db Migrator
What does the Db Migrator skill do?
Is Db Migrator safe to install?
What can Db Migrator access on my machine?
How current is this page?
Sources
- github.com/laolaoshiren/claude-code-skills-zh/tree/main/skills/d — the audited source at commit 7d69626375c6 and every finding aboveObserved · 19 Oct 2026
Spotted something wrong? Report a correction · Methodology
Keep going in your AI
Opens with this page as the source. We add nothing else to the prompt.
- What does the Db Migrator skill do?
- Is Db Migrator safe to install?
- What can Db Migrator access on my machine?