Skills database-migration
🗄️

database-migration

Safe 🌐 Network access⚙️ External commands

Plan database migrations with rollback safety

Also available from: Doyajin174,CleanExpo

Database migrations can break production if rushed. This skill provides proven patterns for safe schema changes, data transforms, and rollbacks across Sequelize, TypeORM, and Prisma.

Supports: Claude Codex Code(CC)
📊 70 Adequate
1

Download the skill ZIP

2

Upload in Claude

Go to Settings → Capabilities → Skills → Upload skill

3

Toggle on and start using

Test it

Using "database-migration". Provide a zero downtime plan to rename users.name to users.full_name

Expected outcome:

  • Phase 1: Add new full_name column alongside existing name column
  • Phase 2: Deploy code that writes to both columns simultaneously
  • Phase 3: Run backfill to copy name values to full_name in batches
  • Phase 4: Switch application reads to use full_name column
  • Phase 5: After verification, remove old name column in separate deployment

Using "database-migration". Create a checkpoint-based rollback strategy for migrating a full_address field

Expected outcome:

  • Create backup table with CREATE TABLE AS SELECT before migration
  • Perform migration in small batches with verification after each batch
  • On failure, restore using DROP TABLE and CREATE TABLE AS SELECT from backup
  • Drop backup table after successful verification

Security Audit

Safe
v4 • 1/17/2026

The static analyzer flagged 42 potential issues, but all are false positives. SKILL.md contains only documentation and code examples for database migration patterns. The 'weak cryptographic algorithm' findings were triggered by text patterns in documentation describing migration operations. The 'Ruby/shell backtick execution' findings misidentified command-line comments as shell execution. No actual executable code, credential access, or network exfiltration patterns exist. This is static instructional content only.

2
Files scanned
603
Lines analyzed
2
findings
4
Total audits
Audited by: claude View Audit History →

Quality Score

38
Architecture
100
Maintainability
87
Content
22
Community
100
Security
91
Spec Compliance

What You Can Build

Zero downtime rollout

Plan phased migrations that keep the application available during schema changes with blue-green deployment strategies.

Data transformation

Design safe data backfills and column refactors with checkpoint-based rollback options for large datasets.

ORM migration strategy

Compare migration approaches when switching between Sequelize, TypeORM, and Prisma with compatibility considerations.

Try These Prompts

Basic migration plan
Create a safe migration plan to add a non-null status column with a default value in Sequelize, including rollback steps and data backfill considerations.
Rename with zero downtime
Outline a zero downtime process to rename users.name to users.full_name with phased deployment, backfill strategy, and cleanup steps.
Cross database change
Show a migration approach that handles JSON type differences between MySQL and PostgreSQL in TypeORM with conditional logic.
Advanced rollback strategy
Design a checkpoint-based rollback strategy for a data migration that splits a full_address field into street, city, state, and zip components.

Best Practices

  • Always provide a rollback step for every migration with proper down() methods
  • Test migrations on staging data that mirrors production before deployment
  • Use small, incremental schema changes rather than large monolithic migrations

Avoid

  • Dropping columns before verifying data backfill and application compatibility
  • Running large migrations without transaction boundaries or rollback plans
  • Ignoring NULL value handling and foreign key constraint impacts during transforms

Frequently Asked Questions

Which ORMs are supported?
The skill includes comprehensive examples for Sequelize, TypeORM, and Prisma with migration patterns for each.
Are there size limits for migrations?
No size limits, but the skill recommends batching large data migrations and using checkpoint-based approaches for millions of rows.
Can I integrate this with CI pipelines?
Yes, the migration patterns can be incorporated into CI/CD workflows with proper testing and rollback procedures.
Does it access my database or secrets?
No, this is static guidance content with no data access, network calls, or credential handling capabilities.
What if a migration fails mid-run?
Use the transaction-based patterns for automatic rollback, or checkpoint-based strategies for manual recovery from backups.
How does it compare to migration tools?
It provides architectural patterns and best practices rather than automated execution, complementing tools like Flyway or Liquibase.

Developer Details

File structure

📄 SKILL.md