AgentSkillsCN

Backend Migrations

创建和管理数据库迁移,具备可逆变更、正确命名规范和零停机部署考量。在创建新的数据库迁移、修改模式变更、添加或删除表/列、创建索引,或管理数据迁移时使用此技能。在 migrations/、db/migrate/、alembic/ 或 prisma/migrations/ 目录下的文件中工作时使用。在编写 up/down 迁移方法、规划生产部署的模式变更,或审查迁移文件以确保安全性和回滚能力时使用。

SKILL.md
--- frontmatter
name: Backend Migrations
description: Create and manage database migrations with reversible changes, proper naming conventions, and zero-downtime deployment considerations. Use this skill when creating new database migrations, modifying schema changes, adding or removing tables/columns, creating indexes, or managing data migrations. When working on files in migrations/, db/migrate/, alembic/, or prisma/migrations/ directories. When writing up/down migration methods, planning schema changes for production deployments, or reviewing migration files for safety and rollback capability.

When to use this skill:

  • When creating new database migration files
  • When modifying existing migrations before deployment
  • When adding, altering, or dropping database tables or columns
  • When creating or removing database indexes
  • When working on files in migrations/, db/migrate/, alembic/, or prisma/migrations/ directories
  • When writing rollback/down methods for migrations
  • When planning schema changes that need to be backwards compatible
  • When separating schema changes from data migrations
  • When creating indexes on large tables with concurrent options
  • When naming migration files descriptively
  • When reviewing migrations for zero-downtime deployment safety

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.

Instructions

For details, refer to the information provided in this file: backend migrations