Database Migration Manager
CautionPlan and execute database schema migrations with rollback support, data preservation, and zero-downtime strategies.
Install
Claude Code
claude install database-migration About This Skill
Overview
Database Migration Manager handles the complexity of evolving your database schema over time. It generates migration files, plans safe execution strategies, and ensures data integrity throughout the process.
Key Features
- Migration Generation: Creates timestamped migration files with both up and down scripts. Supports SQL migrations and ORM-specific formats (Prisma, Knex, Drizzle, Alembic).
- Breaking Change Detection: Identifies migrations that could break existing queries or application code, such as column renames, type changes, or NOT NULL additions on populated tables.
- Zero-Downtime Strategies: For production databases, suggests multi-step migration patterns (expand-contract) that avoid locking tables or breaking running applications.
- Rollback Planning: Every migration comes with a tested rollback script. Complex migrations include data preservation steps to ensure no information is lost during rollback.
Supported Databases
PostgreSQL, MySQL, SQLite, and SQL Server. ORM support includes Prisma, Drizzle, Knex, TypeORM, SQLAlchemy, and Django ORM. Each generates idiomatic migration files for the target platform.
Safety Measures
All destructive operations require double confirmation. The skill checks for foreign key dependencies before DROP operations and warns about data loss. A dry-run mode shows exactly what SQL will execute.
Use Cases
- Generate migration files for schema changes with up/down scripts
- Plan zero-downtime migration strategies for production databases
- Detect breaking schema changes and suggest safe migration paths
- Create data backfill scripts for new columns with default values
Pros & Cons
Pros
- + Prevents data loss with comprehensive rollback planning
- + Zero-downtime strategies keep production running during migrations
- + Supports all major databases and ORMs
- + Breaking change detection catches issues before deployment
Cons
- - Complex data transformations may require manual SQL beyond generated scripts
- - Performance impact of large-table migrations needs manual estimation
Related AI Tools
Claude
Freemium
Anthropic's AI assistant built for thoughtful analysis and safe, nuanced conversations
- 200K token context window for massive document processing
- Artifacts — interactive side-panel for code, docs, and visualizations
- Projects with persistent context and custom instructions
Cursor
Freemium
AI-native code editor with deep multi-model integration and agentic coding
- AI-native Cmd+K inline editing and generation
- Composer Agent for autonomous multi-file changes
- Full codebase indexing and context awareness
Amazon Q Developer
Freemium
AWS-integrated AI assistant for coding, debugging, and cloud operations
- Unlimited free code suggestions across 15+ languages
- Deep AWS service and API understanding
- Automated code transformation (Java upgrades, .NET migration)
Related Skills
Prisma ORM Workflow
CautionDesign Prisma schemas, generate migrations, optimize queries, and implement type-safe database access patterns.
API Builder
CautionScaffold REST and GraphQL APIs with route generation, validation, authentication middleware, and OpenAPI documentation.
Error Handling Patterns
VerifiedImplement comprehensive error handling with typed errors, recovery strategies, logging integration, and user-friendly messages.
Stay Updated on Agent Skills
Get weekly curated skills + safety alerts
每周精选 Skills + 安全预警