Skip to content
Latchkey

Django "makemigrations --check" Fails in CI (Missing Migrations)

A CI guard runs makemigrations --check --dry-run to ensure every model change has a migration. It exits non-zero because a model was edited without generating the matching migration file.

What this error means

The CI step fails reporting that models have changes not yet reflected in a migration. It is deterministic - the same uncommitted model change is detected every run until you create the migration.

Django output
Migrations for 'orders':
  orders/migrations/0007_order_status.py
    + Add field status to order

Your models have changes that are not yet reflected in a migration.
(makemigrations --check exited 1)

Common causes

Model changed without makemigrations

A field or model was added/altered in code, but python manage.py makemigrations was never run, so no migration captures it.

Migration generated but not committed

The migration file was created locally but not added to git, so CI still sees the model change as unreflected.

How to fix it

Generate and commit the migration

Create the migration for the changed app and commit it alongside the model change.

Terminal
python manage.py makemigrations orders
git add orders/migrations/0007_order_status.py

Keep the check as a CI guard

Run the check so any future model change without a migration fails fast.

.github/workflows/ci.yml
python manage.py makemigrations --check --dry-run

How to prevent it

  • Run makemigrations whenever you change a model and commit the result.
  • Keep makemigrations --check --dry-run in CI to catch omissions.
  • Review that migration files are staged in the same PR as model changes.

Frequently asked questions

What causes ""Your models have changes ... no migrations""?
A field or model was added/altered in code, but python manage.py makemigrations was never run, so no migration captures it.
How do I fix "Your models have changes ... no migrations"?
Create the migration for the changed app and commit it alongside the model change.

Related guides

References

Latchkey auto-heals failures like this one - detected, fixed, and retried without you. Start free → 30-day trial · No credit card