backend-migrations
为架构变更创建和管理数据库迁移,确保零停机部署和数据完整性。在创建迁移文件、修改数据库模式、添加或更改表/列/索引,或使用迁移工具(如 Alembic、Flyway、Liquibase 或框架特定的迁移系统)时使用此功能。实现具有上/下方法的可逆迁移、单独处理数据迁移与架构变更、在大表上创建索引,或为高可用性系统计划向后兼容的架构变更时应用此功能。此功能确保迁移是版本控制、专注、安全可回滚,并且与 CI/CD 管道和零停机部署策略兼容。
📖 中文导读:为架构变更创建和管理数据库迁移,确保零停机部署和数据完整性。在创建迁移文件、修改数据库模式、添加或更改表/列/索引,或使用迁移工具(如 Alembic、Flyway、Liquibase 或框架特定的迁移系统)时使用此功能。实现具有上/下方法的可逆迁移、单独处理数据迁移与架构变更、在大表上创建索引,或为高可用性系统计划向后兼容的架构变更时应用此功能。此功能确保迁移是版本控制、专注、安全可回滚,并且与 CI/CD 管道和零停机部署策略兼容。 以下正文为该技能的原始 SKILL.md 内容(英文),上方安装命令可直接使用。
name: Backend Migrations description: Create and manage database migrations for schema changes, ensuring zero-downtime deployments and data integrity. Use this skill when creating migration files, modifying database schemas, adding or altering tables/columns/indexes, or working with migration tools like Alembic, Flyway, Liquibase, or framework-specific migration systems (Django migrations, Rails migrations, Prisma migrations). Apply this skill when implementing reversible migrations with up/down methods, handling data migrations separately from schema changes, creating indexes on large tables, or planning backwards-compatible schema changes for high-availability systems. This skill ensures migrations are version-controlled, focused, safe to rollback, and compatible with CI/CD pipelines and zero-downtime deployment strategies.
Backend Migrations
This Skill provides Claude Code with specific guidance on how to adhere to coding standards as they relate to how it should handle backend migrations.
When to use this skill
- When creating new database migration files for schema changes
- When adding, removing, or modifying database tables, columns, or constraints
- When creating or dropping indexes, foreign keys, or unique constraints
- When working with migration tools like Alembic, Flyway, Liquibase, Django migrations, or Rails migrations
- When implementing reversible migrations with proper up/down or forward/backward methods
- When separating schema changes from data migrations for safety
- When planning zero-downtime deployments requiring backwards-compatible changes
- When creating indexes on large tables using concurrent/online index creation
- When modifying migration files in
migrations/,db/migrate/, or similar directories - When setting up migration version control and naming conventions
- When implementing migration testing in staging environments
- When handling migration rollbacks or fixing failed migrations
Instructions
For details, refer to the information provided in this file: backend migrations