MITupdated 20d ago
Apply pending database migrations to a target environment (dev, staging, production) using Alembic.
What can you do with Db:migrate?
name: "db:migrate" description: "Run database migrations against the target environment. Use when applying schema changes, running pending migrations, or checking migration status. Do NOT use for seed data insertion or database backups." argument-hint: " [--status] [--rollback ]" user-invocable: true
Database Migration Runner
Apply pending database migrations to a target environment (dev, staging, production) using Alembic.
Procedure
Step 1: Determine Target Environment
Read the environment argument. Valid values: dev, staging, production.
If production is specified, require confirmation via AskUserQuestion before proceeding:
"You are about to run migrations against PRODUCTION. This cannot be undone automatically. Continue?"
Step 2: Check Migration Status
alembic --config config/${env}.ini current
alembic --config config/${env}.ini heads
If --status flag is set, display current revision and pending migrations, then stop.
Step 3: Run Pending Migrations
alembic --config config/${env}.ini upgrade head
Report the number of migrations applied and the new current revision.
Step 4: Verify Schema
Run the schema validation script:
python scripts/verify_schema.py --env ${env}
Report any discrepancies between the expected schema and the actual database state.
If --rollback <N> is specified, roll back N migrations instead of applying:
alembic --config config/${env}.ini downgrade -${N}
Install
Add Db:migrate to your client. Pick the one you use.
npx skills add rhuss/cc-skillInstalls every skill in the repository, then prompts for which to keep.
/plugin marketplace add rhuss/cc-skillAdds the repository as a plugin marketplace; install individual plugins with `/plugin install`.
git clone https://github.com/rhuss/cc-skill
cp -r eval/runs/cc-skill-checker-eval/2026-06-01-opus/cases/case-003-mixed-quality-migration/_modified/target-skill ~/.claude/skills/A skill is a plain directory. Copy it into `.claude/skills/` in a project or in your home directory.
Score
67 / 100
Good