django-migration-psql
Installation
SKILL.md
When to use
- Creating a new Django migration
- Running
makemigrationsorpgmakemigrations - Reviewing a PR that adds or modifies migrations
- Adding indexes, constraints, or models to the database
Why this matters
A bad migration can lock a production table for minutes, block all reads/writes, or silently skip index creation on partitioned tables.
Auto-generated migrations need splitting
makemigrations and pgmakemigrations bundle everything into one file: CreateModel, AddIndex, AddConstraint, sometimes across multiple tables. This is the default Django behavior and it violates every rule below.
After generating a migration, ALWAYS review it and split it:
- Read the generated file and identify every operation
- Group operations by concern:
Related skills