migrate:create

migrate:create is a command for Claude Code from ruslan-korneev/claude-plugins. It costs 18 tokens per session (934 once invoked), scanned A, original, MIT.

A command for creating Alembic database migrations, which are files that describe changes to a database's structure over time. It generates a migration and fixes certain downgrade cases involving enums, arrays, and JSON or JSONB fields.

In plain words
What is it for?
Use `/migrate:create` when creating an Alembic migration for schema changes involving enum values, array element types, or nullable JSON fields.
Why use it?
It addresses gaps in automatically generated reverse migrations, especially when an enum is created but not removed during downgrade. It also handles some data or type changes that need extra migration code.

Command for Claude Code

Written for Claude Code: allowed-tools in frontmatter.

Part of the fastapi plugin — 2 skills, 5 commands, 1 agent shipped together

Good fit Use /migrate:create when creating an Alembic migration for schema changes involving enum values, array element types, or nullable JSON fields.

Compare 6 commands from other repositories ↓
Install with agentmods
npx agentmods add commands/ruslan-korneev/claude-plugins/migrate-create
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Clone the repo
git clone --depth 1 https://github.com/ruslan-korneev/claude-plugins

Made for: Claude Code.

Or install fastapi, the plugin that ships this one along with the rest of its 2 skills, 5 commands, 1 agent.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for migrate:create

README.md
[![agentmods](https://agentmods.dev/badge/commands/ruslan-korneev/claude-plugins/migrate-create/github.svg)](https://agentmods.dev/commands/ruslan-korneev/claude-plugins/migrate-create)
Your own site
<a href="https://agentmods.dev/commands/ruslan-korneev/claude-plugins/migrate-create"><img src="https://agentmods.dev/badge/commands/ruslan-korneev/claude-plugins/migrate-create/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for migrate:create

Your own site · 80×15
<a href="https://agentmods.dev/commands/ruslan-korneev/claude-plugins/migrate-create"><img src="https://agentmods.dev/badge/commands/ruslan-korneev/claude-plugins/migrate-create.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 18 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 934 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00018 $0.00934
Opus 5.5 $0.00007 $0.00374
Sonnet 5.5 $0.00004 $0.00187
Haiku 4.5 $0.00002 $0.00093

Measured 1mo ago against content hash 6b34b7ca01a0, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

migrate:create scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 1mo ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

plugins/fastapi/commands/migrate-create.md · 174 lines

How it starts

The opening of the file, as written. The whole thing — 174 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Command /migrate:create

Create an Alembic migration with automatic fixing of problematic types.

Principle

Alembic does not always correctly generate downgrade for:

  • Enum types — creates in upgrade, but does NOT delete in downgrade
  • Array types — problems when changing element type
  • JSON/JSONB — nullable changes require data migration

Instructions

Step 1: Create migration

alembic revision --autogenerate -m "{{ message }}"

Step 2: Find the created file

ls -la alembic/versions/*.py | head -1

Step 3: Check and fix migration

Enum types

Problem: Alembic creates enum in upgrade, but does not delete in downgrade.

Auto-fix:

# Find all enums in the file
# Pattern: sa.Enum("value1", "value2", name="enum_name")

If enum is found:

# Add at the beginning of the file
status_type = sa.Enum("pending", "active", "inactive", name="status_type")

def upgrade() -> None:
    # status_type is created automatically when creating the column
    op.create_table(
        "users",
        sa.Column("id", sa.Integer(), nullable=False),
        sa.Column("status", status_type, nullable=False),
        sa.PrimaryKeyConstraint("id"),
    )

def downgrade() -> None:
    op.drop_table("users")
    # IMPORTANT: Delete enum type
    status_type.drop(op.get_bind(), checkfirst=False)
Adding column with enum
# upgrade
def upgrade() -> None:
    status_type = sa.Enum("pending", "active", name="status_type")
    status_type.create(op.get_bind(), checkfirst=True)

    op.add_column(
        "users",
        sa.Column("status", status_type, nullable=True),
    )

# downgrade
def downgrade() -> None:
    op.drop_column("users", "status")
    # Enum remains if used in other tables
    # sa.Enum(name="status_type").drop(op.get_bind(), checkfirst=True)
Array types
# When changing array element type
def upgrade() -> None:
    # First delete old column
    op.drop_column("users", "tags")
    # Create with new type
    op.add_column(
        "users",
        sa.Column("tags", sa.ARRAY(sa.String(100)), nullable=True),
    )

def downgrade() -> None:
    op.drop_column("users", "tags")
    op.add_column(
        "users",
        sa.Column("tags", sa.ARRAY(sa.String(50)), nullable=True),
    )

Read the full file on GitHub · 174 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 1mo ago First seen · 174 lines · 18 tokens per session scan A 6b34b7ca01a0

Subscribe to this mod's changes

migrate:create is a command published in the GitHub repository ruslan-korneev/claude-plugins (5 stars, last pushed 7mo ago), licensed MIT. It adds 18 tokens to every session and 934 once invoked, about $0.0001 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.