一键导入
migrate
Run/create DB migrations (Alembic, Prisma, Laravel, Django, Flyway, Drizzle); checks backup. Triggers: apply migration, rollback, generate migration.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Run/create DB migrations (Alembic, Prisma, Laravel, Django, Flyway, Drizzle); checks backup. Triggers: apply migration, rollback, generate migration.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
REST/GraphQL API design: naming, versioning, pagination, idempotency, OpenAPI. Triggers: API design, REST, GraphQL, OpenAPI, Swagger, idempotency, rate limit.
Direct technical voice for docs, README, user-facing text. Concise/strict modes. Triggers: documentation, README, content, output-mode, voice, prose style.
Multi-source web research methodology: retrieve-vs-answer gate, complexity-scaled search budget, query craft, primary-source preference, source-conflict skepticism, adversarial verification, attribution-without-reproduction. Triggers: deep research, multi-source, web research, synthesize sources, cross-reference, fact synthesis, source verification.
UI craftsmanship: animation rules, easing, micro-interactions, state polish. Triggers: animation, transition, ease-out, motion, micro-interaction, hover, loading state, UI polish.
Builds production MCP servers via 4-phase methodology: research, implement, test, evaluate. Triggers: build MCP, new MCP, MCP integration, MCP server scaffold.
MCP server design: tool schemas, resources, stdio/SSE, capability negotiation. Triggers: MCP, Model Context Protocol, JSON-RPC, stdio, SSE, Claude Desktop.
| name | migrate |
| description | Run/create DB migrations (Alembic, Prisma, Laravel, Django, Flyway, Drizzle); checks backup. Triggers: apply migration, rollback, generate migration. |
| effort | medium |
| disable-model-invocation | true |
| argument-hint | [direction] |
| allowed-tools | Bash, Read |
| hooks | {"PreToolUse":[{"matcher":"Bash","hooks":[{"type":"command","command":"echo 'Reminder: ensure database backup exists before running migrations'"}]}]} |
| scripts | ["scripts/migration-status.py"] |
$ARGUMENTS
Create, run, or manage database migrations with auto-detection of the migration tool.
ls alembic.ini prisma/ database/migrations/ manage.py 2>/dev/nullDetect migration tool and report status:
python3 scripts/migration-status.py [directory]
Returns JSON with: tool, config_file, migrations_dir, total_migrations, latest, commands{} (status/create/upgrade/downgrade).
| File Found | Tool | Commands |
|---|---|---|
alembic.ini | Alembic | alembic revision, alembic upgrade |
prisma/schema.prisma | Prisma | npx prisma migrate dev |
database/migrations/ + artisan | Laravel | php artisan migrate |
manage.py | Django | python manage.py migrate |
flyway.conf | Flyway | flyway migrate |
drizzle.config.ts | Drizzle | npx drizzle-kit push |
--pretend, --sql)/migrate # Show migration status
/migrate create add_users # Create new migration
/migrate run # Apply pending migrations
/migrate rollback # Rollback last migration
/migrate status # Show applied/pending migrations
Use migration-patterns skill for zero-downtime strategies and best practices.
--pretend / --sql) before applying — the user approves the diff, not just the commandALTER TABLE ... ALGORITHM=INPLACE, CREATE INDEX CONCURRENTLY) — table locks in production cause outages, not slowdownsalembic upgrade head silently skips migrations with branches if the branch head is not explicit. Multi-head migrations need alembic upgrade <revision>@head or a merge migration first.prisma migrate dev auto-generates migrations AND applies them AND reseeds the dev database. Running it on a production-connected config destroys data. Always use prisma migrate deploy in non-dev.migrate command without --force refuses to run in APP_ENV=production. Scripts that blindly run migrate hang on interactive prompts in prod — always use artisan migrate --force in automation.migrate --fake marks a migration as applied without running it. Intended for manual data fixes, but accidentally using it skips real schema changes and silently diverges production from code.CREATE INDEX CONCURRENTLY (Postgres) cannot run inside a transaction. Alembic wraps each migration in a transaction by default — concurrent index creation needs op.execute() with autocommit_block() or a manual COMMIT./migration-patterns/database-patterns/rollback/ci or /deploy/app-builder instead of ad-hoc SQL