Skip to content
Latchkey

Django "makemigrations --check" reports changes detected in CI

A CI gate runs makemigrations --check --dry-run to ensure every model change has a committed migration. When it exits non-zero, a developer changed a model but did not generate and commit the migration file.

What this error means

The gate step fails with a non-zero exit and a message that changes were detected, such as "Your models in app(s): 'app' have changes that are not yet reflected in a migration."

Django
Your models in app(s): 'app' have changes that are not yet reflected in a migration,
and so won't be applied.
Run 'manage.py makemigrations' to make new migrations, ...

Common causes

A model changed without a new migration

A field was added or altered but makemigrations was never run, so the schema in code and the migration graph diverge.

The migration file was not committed

The migration was generated locally but left out of the commit, so CI sees pending changes.

How to fix it

Generate and commit the migration

  1. Run python manage.py makemigrations locally.
  2. Review and commit the new migration file.
  3. Re-run the gate to confirm no changes remain.
Terminal
python manage.py makemigrations
git add app/migrations/

Keep the gate in CI

Fail the build when a model change lacks a migration so it never reaches production.

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

How to prevent it

  • Run makemigrations whenever a model changes and commit the file.
  • Keep makemigrations --check --dry-run as a required CI gate.
  • Review migration files in code review alongside model changes.

Related guides

Tired of flaky CI? Latchkey auto-heals failed jobs and retries them for you. Start free →