backend-migrations
使用可逆更改、零停机部署和适当的版本控制实践创建和管理数据库迁移。在创建数据库迁移文件、架构更改脚本或任何修改数据库结构的文件时使用此技能。在编写带有up/down方法的迁移文件、实现回滚策略、创建或修改数据库表、添加或删除列、创建索引或将数据迁移与架构更改分开处理时使用此技能。在使用迁移目录中的文件(如db/migrate/、migrations/或database/migrations/)或修改架构定义文件时使用。
📖 中文导读:使用可逆更改、零停机部署和适当的版本控制实践创建和管理数据库迁移。在创建数据库迁移文件、架构更改脚本或任何修改数据库结构的文件时使用此技能。在编写带有up/down方法的迁移文件、实现回滚策略、创建或修改数据库表、添加或删除列、创建索引或将数据迁移与架构更改分开处理时使用此技能。在使用迁移目录中的文件(如db/migrate/、migrations/或database/migrations/)或修改架构定义文件时使用。 以下正文为该技能的原始 SKILL.md 内容(英文),上方安装命令可直接使用。
name: Backend Migrations description: Create and manage database migrations with reversible changes, zero-downtime deployments, and proper version control practices. Use this skill when creating database migration files, schema change scripts, or any files that modify database structure. Use this when writing migration files with up/down methods, implementing rollback strategies, creating or modifying database tables, adding or removing columns, creating indexes, or handling data migrations separately from schema changes. Use this when working on files in migration directories like db/migrate/, migrations/, or database/migrations/, or when modifying schema definition files.
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 in directories like db/migrate/, migrations/, or database/migrations/
- When writing migration scripts that modify database schema (creating/altering/dropping tables)
- When implementing reversible migrations with proper up/down or rollback methods
- When adding or removing database columns, indexes, or constraints
- When creating migrations for zero-downtime deployments
- When separating schema changes from data migrations
- When managing index creation on large tables with concurrent options
- When writing migration naming conventions and descriptive migration names
- When modifying schema definition files or database structure files
- When ensuring backwards compatibility in database changes
Instructions
For details, refer to the information provided in this file: backend migrations