A Claude Code slash command for database migration management with schema analysis.
# 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/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
- Detects migration framework (Prisma, Knex, Alembic, etc.)
- Shows migration status and schema drift
- Creates new migrations with templates
- Runs or rolls back migrations safely
- Updates type definitions after changes
| Framework | Language |
|---|---|
| Prisma | Node.js |
| Drizzle | Node.js |
| Knex | Node.js |
| TypeORM | Node.js |
| golang-migrate | Go |
| goose | Go |
| Alembic | Python |
| Django | Python |
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 |
- Dry run mode to preview SQL
- Backup reminders before destructive changes
- Rollback confirmation prompts
- Type synchronization after migrations
- Database migration tool installed
- Claude Code with Opus 4.5 model access
cd <clone-path>/command-migration && git pull