Overview
Help create and manage database migrations, generating complete migration files following the project's database framework conventions.
Steps
- 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
- Migration Script Generation
- Create up and down migration scripts
- Include proper indexing and constraint management
- Add data migration logic where needed
- Implement rollback procedures
- 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
- Testing Strategy