AgentSkillsCN

Backend Migrations

创建并管理数据库迁移,支持可逆的上下方法、零停机部署策略和恰当的模式版本控制。在创建数据库迁移文件、更改表模式、添加或修改数据库索引或实施数据迁移时使用此技能。在使用TypeORM迁移、Sequelize迁移、Alembic(Python)、Rails迁移、Flyway或Liquibase等迁移工具时使用。在编写迁移文件(如YYYYMMDDHHMMSS_迁移名称.ts、001_create_table.sql、versions/*.py)或以版本控制方式修改数据库模式时使用。在处理高可用性部署的向后兼容性或分离模式变更与数据迁移时使用。

SKILL.md
--- frontmatter
name: Backend Migrations
description: Create and manage database migrations with reversible up/down methods, zero-downtime deployment strategies, and proper schema versioning. Use this skill when creating database migration files, altering table schemas, adding or modifying database indexes, or implementing data migrations. Use when working with migration tools like TypeORM migrations, Sequelize migrations, Alembic (Python), Rails migrations, Flyway, or Liquibase. Use when writing migration files (e.g., YYYYMMDDHHMMSS_migration_name.ts, 001_create_table.sql, versions/*.py) or when modifying database schema in a version-controlled manner. Use when handling backwards compatibility for high-availability deployments or when separating schema changes from data migrations.

Backend Migrations

This Skill provides Claude Code with specific guidance on how to adhere to coding standards for database migrations and schema versioning.

When to use this skill

  • When creating new database migration files for schema changes
  • When working with migration files (.ts, .js, .py, .sql) in migrations directories
  • When altering table structures (adding/removing columns, changing types)
  • When creating or modifying database indexes on tables
  • When implementing data migrations or backfilling existing data
  • When writing reversible migration rollback methods (down/rollback functions)
  • When handling zero-downtime deployments with backwards-compatible schema changes
  • When separating schema changes from data transformations
  • When using migration tools (TypeORM, Sequelize, Alembic, Rails Active Record, Flyway, Liquibase)
  • When managing database version control and migration history

Instructions

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