Schema Migration
Create safe, zero-downtime schema migrations with rollback procedures
Best use case
Schema Migration is best used when you need a repeatable AI agent workflow instead of a one-off prompt.
Create safe, zero-downtime schema migrations with rollback procedures
Teams using Schema Migration should expect a more consistent output, faster repeated execution, less prompt rewriting.
When to use this skill
- You want a reusable workflow that can be run more than once with consistent structure.
When not to use this skill
- You only need a quick one-off answer and do not need a reusable workflow.
- You cannot install or maintain the underlying files, dependencies, or repository context.
Installation
Claude Code / Cursor / Codex
Manual Installation
- Download SKILL.md from GitHub
- Place it in
.claude/skills/schema-migration/SKILL.mdinside your project - Restart your AI agent — it will auto-discover the skill
How Schema Migration Compares
| Feature / Agent | Schema Migration | Standard Approach |
|---|---|---|
| Platform Support | Not specified | Limited / Varies |
| Context Awareness | High | Baseline |
| Installation Complexity | Unknown | N/A |
Frequently Asked Questions
What does this skill do?
Create safe, zero-downtime schema migrations with rollback procedures
Where can I find the source code?
You can find the source code on GitHub using the link provided at the top of the page.
SKILL.md Source
# Schema Migration Skill Create safe, zero-downtime schema migrations with rollback procedures. ## Trigger Conditions - Migration file created or modified - ORM model changes detected - User invokes with "create migration" or "schema change" ## Input Contract - **Required:** Current schema state - **Required:** Desired schema change - **Optional:** Data volume estimate, downtime tolerance ## Output Contract - Migration SQL (up and down) - Backward-compatibility assessment - Lock time estimate for large tables - Data backfill strategy (if applicable) ## Tool Permissions - **Read:** Schema files, existing migrations, ORM models - **Write:** Migration files - **Execute:** Schema comparison tools, EXPLAIN ANALYZE ## Execution Steps 1. Analyze desired change against current schema 2. Determine if change is backward-compatible with N-1 app version 3. Apply expand-and-contract pattern if needed 4. Write UP migration with safety guards (IF NOT EXISTS, CONCURRENTLY) 5. Write DOWN migration (rollback) 6. Estimate lock time for table size 7. Design backfill strategy for data changes 8. Test both UP and DOWN against staging data ## Success Criteria - Migration is backward-compatible with current app version - Both UP and DOWN migrations tested - Lock time estimated and acceptable - Migration is idempotent (safe to re-run) ## Escalation Rules - Escalate if lock time estimate >30 seconds - Escalate if migration requires data backfill on >10M rows - Escalate if migration affects multiple services ## Example Invocations **Input:** "Add a non-null 'organization_id' column to the users table (5M rows)" **Output:** 3-phase migration: Phase 1 (ADD COLUMN organization_id nullable, backfill from org_memberships, ~2min), Phase 2 (SET NOT NULL after backfill verified), Phase 3 (ADD INDEX CONCURRENTLY on organization_id, ~45s). Rollback: DROP COLUMN in each phase. Total estimated time: 4 minutes with zero downtime.
Related Skills
claude-opus-4-5-migration
Migrate prompts and code from Claude Sonnet 4.0, Sonnet 4.5, or Opus 4.1 to Opus 4.5. Use when the user wants to update their codebase, prompts, or API calls to use Opus 4.5. Handles model string updates and prompt adjustments for known Opus 4.5 behavioral differences. Does NOT migrate Haiku 4.5.
airflow-3x-migration
Comprehensive guide and patterns for migrating Apache Airflow 2.x workflows to Airflow 3.x, covering import changes, deprecated features, and new paradigms like Asset scheduling and TaskFlow API.
tuist-migration
Integrates Tuist into an existing iOS project that uses SPM local packages. Use when migrating a project from a manually maintained .xcodeproj to a Tuist-generated project, adding Tuist as an orchestration layer on top of SPM. Covers 8 sequential phases — audit, base structure, helpers, generation, schemes, CI, cache, and validation. Includes automation scripts and AI prompt templates for each phase.
Schema Evolution Impact Analysis
Analyze the impact of model/schema changes on downstream code — affected repositories, services, handlers, tests, and migration requirements
Schema Design
Migration-ready database schema design with normalization and indexing strategies
Migration Planner
Plan safe, zero-downtime migrations for schemas, services, and infrastructure
database-migrations-sql-migrations
SQL database migrations with zero-downtime strategies for PostgreSQL, MySQL, SQL Server
database-migration
Execute database migrations across ORMs and platforms with zero-downtime strategies, data transformation, and rollback procedures. Use when migrating databases, changing schemas, performing data tr...
architecting-database-schema
Defines schema, attributes, indexes, and enums for Tourly collections. Use when setting up the database in Appwrite.
apply-migration
Apply SQL migration files to JusticeHub Supabase database with verification and error handling.
api-schema-analyzer
Analyze OpenAPI and Postman schemas for MCP tool generation. Use when analyzing API specifications, extracting endpoint information, generating tool signatures, or when user mentions OpenAPI, Swagger, API schema, endpoint analysis.
allra-database-schema
Allra 데이터베이스 설계 및 QueryDSL 사용 규칙. Use when creating JPA entities, writing QueryDSL queries, or adding @Transactional annotations.