Skip to content

claude-commands/command-migration

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 

Repository files navigation

command-migration

A Claude Code slash command for database migration management with schema analysis.

Installation

# Clone to your preferred location
git clone git@github.com:claude-commands/command-migration.git <clone-path>/command-migration

# Symlink (use full path to cloned repo)
ln -s <clone-path>/command-migration/migration.md ~/.claude/commands/migration.md

Usage

/migration                        # Show migration status
/migration create add_users       # Create new migration
/migration run                    # Run pending migrations
/migration rollback               # Rollback last migration
/migration status                 # Show applied/pending migrations

What it does

  1. Detects migration framework (Prisma, Knex, Alembic, etc.)
  2. Shows migration status and schema drift
  3. Creates new migrations with templates
  4. Runs or rolls back migrations safely
  5. Updates type definitions after changes

Supported Frameworks

Framework Language
Prisma Node.js
Drizzle Node.js
Knex Node.js
TypeORM Node.js
golang-migrate Go
goose Go
Alembic Python
Django Python

Output Format

Migration Status

Database: postgresql://localhost/myapp_dev
Framework: Prisma

Applied Migrations (5):
| # | Name               | Applied At          |
| - | ------------------ | ------------------- |
| 1 | 20240101_init      | 2024-01-01 10:00:00 |

Pending Migrations (1):
| # | Name               | Created    |
| - | ------------------ | ---------- |
| 1 | 20240201_add_tags  | 2024-02-01 |

Safety Features

  • Dry run mode to preview SQL
  • Backup reminders before destructive changes
  • Rollback confirmation prompts
  • Type synchronization after migrations

Requirements

  • Database migration tool installed
  • Claude Code with Opus 4.5 model access

Updates

cd <clone-path>/command-migration && git pull

About

Database migration helper with schema analysis

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published