generate-migration
Skill by getsentry
Generates and reviews Django database migrations for the Sentry codebase. Covers schema changes, data migrations, indexes, and migration lockfile conflicts. Written for Sentry developers.
Install generate-migration
Built from the published package, never by AI.
git clone --depth 1 https://github.com/getsentry/sentry /tmp/sentry && mkdir -p ~/.claude/skills && cp -r /tmp/sentry/.agents/skills/generate-migration ~/.claude/skills/generate-migrationRun in your terminal. Claude Code loads skills from ~/.claude/skills automatically.
git clone --depth 1 https://github.com/getsentry/sentry /tmp/sentry && mkdir -p ~/.gemini/antigravity-cli/skills && cp -r /tmp/sentry/.agents/skills/generate-migration ~/.gemini/antigravity-cli/skills/generate-migrationAntigravity CLI loads skills from ~/.gemini/antigravity-cli/skills, or .agents/skills for one project.
Skills can run scripts on your machine. Some need an API key: check the README.
About
The generate-migration skill guides an AI assistant through creating and reviewing Django database migrations in Sentry. It covers generating migrations with sentry django makemigrations, creating empty migrations for data work, checking the SQL with sqlmigrate, and applying them with sentry django migrate. It also explains how to add columns and indexes, avoid renaming columns in Postgres, and resolve conflicts in migrations_lockfile.txt with bin/update-migration.
The skill sets out multi-step rules for deleting columns and removing models, where the drop is split across two separate pull requests. It also requires that data migrations and backfills have a test built on TestMigrations, and shows how to write one. It is aimed at developers working on Sentry's Django models and migrations.
Written from the project's SKILL.md and checked against it.
What it can do
- Generate migrationsRuns sentry django makemigrations, optionally scoped to one app, to create migrations from model changes.
- Empty migrationsCreates an empty migration with --empty for data migrations or custom work.
- Verify migrationsChecks the generated SQL with sentry django sqlmigrate and applies the migration locally with sentry django migrate.
- Column and index guidanceExplains db_default, null=True, and is_post_deployment for adding columns and large-table indexes.
- Two-phase column deletionDescribes deleting a column in two separate PRs using SafeRemoveField with MOVE_TO_PENDING and DELETE.
- Two-phase model removalDescribes dropping a model and its table in two PRs using SafeDeleteModel and historical_silo_assignments.
- Data migration testsShows how to write a TestMigrations test for backfills, with one test method and subTest per case.
- Merge conflict resolutionExplains using bin/update-migration to resolve conflicts in migrations_lockfile.txt.
What you need
- A Sentry development environment with the sentry CLI and Django commands
Try asking
- Generate a migration for the new field I added to the Project model
- Write a data migration test for backfilling a column in Sentry
- Walk me through the two PRs needed to delete this column safely
Good to know
- Deleting a column or model takes two PRs, and phase 2 must wait until phase 1 has deployed.
- Don't rename columns or tables in Postgres; use db_column or Meta.db_table instead.
- Local migration tests need the --migrations and --reuse-db flags.
Security check
ANo download-and-run commands, hidden instructions or signs of sending keys out were found.
Checked automatically: .agents/skills/generate-migration/SKILL.md. This looks for known risky patterns and is not a full audit. How grades work
Alternatives to generate-migration
All alternatives →Runs a 7-stage workflow for auditing, cleaning up and reviewing GitHub repositories, plus competitor analysis. Written for developers who want a repo checked for secrets, junk files and documentation gaps.
Teaches an AI assistant to build, debug and explain Gradio web UIs and ML demos in Python. It covers the core API, components, event listeners, layouts and the MCP server option. Aimed at Python developers who work with Gradio.
Recommends menus, buttons, toolbars and disclosure controls for Apple platforms using Human Interface Guidelines conventions. Built for developers and designers making iOS, iPadOS, macOS or visionOS interfaces. Checks existing project design context before asking questions.
Creates production-ready FastAPI project structures with async patterns, dependency injection, and error handling. It is for developers starting new FastAPI applications or backend API projects.
Analyzes Android apps to find user workflows to expose as AppFunctions, so AI agents and system shortcuts can run them without opening the app UI. Generates Kotlin code and refines KDoc for Android developers.
Creates, edits, validates and runs Agent QA tests, suites and hooks through MCP or CLI. It keeps canonical IDs and schema contracts intact, for developers and QA teams using Agent QA.
Compare with openclaw-github-repo-commander, gradio or hig-components-menus
generate-migration: common questions
Does this skill write database migrations for Sentry?
Yes. It guides the assistant to generate, review, and apply Django migrations with the sentry django commands, and to write data migration tests.
How do I safely delete a column in Sentry?
The skill says to split the change into two separate PRs. Phase 1 uses SafeRemoveField with MOVE_TO_PENDING, and phase 2 uses DELETE after phase 1 has deployed.
What if my migrations_lockfile.txt has a merge conflict?
The skill says to run bin/update-migration with your migration name. It renames the migration, updates dependencies, and fixes the lockfile.
How do I install generate-migration?
Run the command above to copy the skill into ~/.claude/skills/. Claude Code picks it up automatically.
Is generate-migration free?
The code is published under the NOASSERTION licence. The service it connects to may have its own pricing.
Is generate-migration safe to use?
It scores 80 of 100. Grades: maintenance A, licence F, quality A. Security check: grade A, no risky patterns found in the files checked. Review the code before you install. How grades work.
What are alternatives to generate-migration?
Similar skills: openclaw-github-repo-commander, gradio, hig-components-menus, fastapi-templates.
