# generate-migration

> Claude/Codex skill by [@getsentry](https://omgskills.com/library/getsentry/index.md) · 45k stars · Updated 2026-08-31

Generate Django database migrations for Sentry. Use when creating migrations, adding/removing columns or tables, adding indexes, or resolving migration conflicts.

Tags: apm, crash-reporting, crash-reports, csp-report, devops, django, error-logging, error-monitoring, fair-source, hacktoberfest, monitor, monitoring, python, sentry, tag-production

## Install

```sh
git clone https://github.com/getsentry/sentry /tmp/sentry && ln -s /tmp/sentry/.agents/skills/generate-migration ~/.claude/skills/generate-migration
```

## From README

Generate Django Database Migrations Commands Generate migrations automatically based on model changes: For a specific app: Generate an empty migration (for data migrations or custom work): After Generating If you added a new model, ensure it's imported in the app's init.py Review the generated migration for correctness Run sentry django sqlmigrate to verify the SQL Apply the migration locally with sentry django migrate — Sentry's migration framework runs its safety checks on apply, so this catches unsafe ops (missing ispostdeployment, unsafe column changes, etc.) before CI does. When editing a generated migration (e.g. swapping DeleteModel for SafeDeleteModel), leave the auto-generated ispostdeployment comment block in place. It documents a non-obvious flag with concrete guidance for future migration authors — useful context, not fluff. Only remove a comment if it's stale or contradicts the code. Don't test the ORM Don't write tests that only exercise Django's ORM.

## Links

- HTML page: https://omgskills.com/skills/getsentry/sentry/generate-migration/
- GitHub: https://github.com/getsentry/sentry
- Author: [@getsentry](https://omgskills.com/library/getsentry/index.md)

## More from this repo

- [design-system](https://omgskills.com/skills/getsentry/sentry/design-system/index.md) — Guide for using Sentry's layout and text primitives.
   - [@getsentry](https://omgskills.com/library/getsentry/index.md) · 45k stars
- [cell-architecture](https://omgskills.com/skills/getsentry/sentry/cell-architecture/index.md) — Reference and active migration guide for Sentry's cell architecture.
   - [@getsentry](https://omgskills.com/library/getsentry/index.md) · 45k stars
- [cmdk-actions](https://omgskills.com/skills/getsentry/sentry/cmdk-actions/index.md) — Guide for adding new actions to Sentry's Command+K palette.
   - [@getsentry](https://omgskills.com/library/getsentry/index.md) · 45k stars
