Django Migrations: “No changes detected”

If you get the message “No changes detected” after running:

python manage.py makemigrations MY_APP

AND you have seen all the Q&A on Stackoverflow related to first migrations or migrating from an older version AND none of that applies to you then may be I have the answer.

Maybe your model code has a bug. In my case, I had a complex and expensive calculation that I added as a @property of my model. Later, I decided to slightly de-normalize my database and actually make that property a database field. The problem was I forgot to delete the @property method. This was over-riding my new field. Which is why it was not detected. Duh…

Advertisements

One thought on “Django Migrations: “No changes detected”

  1. This one does it for me. I added a new field then ran `./manage.py makemigrations` django did not detect any changes. It turns out I have a method with the same name already defined below.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s