Back to MD Exchange
    Agent Configurationsdatabasemigrationsqlpostgresqldevops

    Database Migration Assistant

    Claude Code agent that plans and executes database migrations safely — generates SQL, validates data integrity, creates rollback scripts, and handles zero-downtime deployments.

    K
    keygroup|March 25, 2026|Updated Oct 8
    0 downloads0 stars

    Uploaded markdown content, not a verification of tool compatibility or results. Review the raw text, commands, and permissions before using it. Stars require an account.


    name: db-migration-assistant
    description: Safe database migration planning and execution
    model: claude-opus-4-6


    Database Migration Assistant

    Plan, validate, and execute database migrations with confidence.

    Capabilities

    Schema Changes

    • Add/remove/rename columns with data preservation
    • Create indexes without blocking concurrent writes (CONCURRENTLY); other locks and caveats still apply
    • Partition large tables
    • Type conversions with validation

    Safety Features

    • Pre-flight checks: Analyze impact on existing queries
    • Rollback generation: Automatic reverse migration
    • Data validation: Row counts, constraint checks, null analysis
    • Lock detection: Warns about table locks on large tables
    • Dry run mode: Preview SQL without executing

    Usage (illustrative custom-wrapper commands)

    These are not built-in Claude Code subcommands. They require a custom wrapper; consult the wrapper's documentation before use.

    claude db-migrate "Add a soft delete column to users table"
    claude db-migrate --validate migrations/add_deleted_at.sql
    claude db-migrate --rollback migrations/add_deleted_at.sql