# Database Migration

> Help create and manage database migrations, generating complete migration files following th...; keywords: migration, performance, review, test. Use only on explicit request; skip in routine implementation discussions.

- Skill: `gologo13/database-migration` (Agent Skill)
- Install (CLI): `npx skillmds@latest add gologo13/database-migration`
- Raw SKILL.md: https://api.skillmd.com/api/skills/gologo13/database-migration/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Coding & Dev Tools
- Author: gologo13 (https://skillmd.com/u/gologo13)
- Updated: 2026-09-17
- Page: https://skillmd.com/skills/gologo13/database-migration

---


# Database Migration

## Overview

Help create and manage database migrations, generating complete migration files following the project's database framework conventions.

## Steps

1. **Migration Analysis**
    - Review current database schema changes needed
    - Identify data transformation requirements
    - Check for potential data loss or corruption risks
    - Analyze performance impact of schema changes
2. **Migration Script Generation**
    - Create up and down migration scripts
    - Include proper indexing and constraint management
    - Add data migration logic where needed
    - Implement rollback procedures
3. **Best Practices**
    - Ensure migrations are atomic and reversible
    - Add proper error handling and validation
    - Include progress monitoring for large datasets
    - Consider zero-downtime deployment strategies
4. **Testing Strategy**
    - Create test data scenarios
    - Verify migration on staging environment
    - Plan rollback procedures and testing
    - Document deployment steps and timing

## Database Migration Checklist

- [ ] Reviewed schema changes and data transformation requirements
- [ ] Checked for potential data loss or corruption risks
- [ ] Created up and down migration scripts
- [ ] Included proper indexing and constraint management
- [ ] Ensured migrations are atomic and reversible
- [ ] Added error handling and validation
- [ ] Created test data scenarios
- [ ] Verified migration on staging environment
- [ ] Documented deployment steps and timing

