Yunti
Yunti

Reputation: 7428

django makemigrations no longer detects changes (1.8+)

If I make a change to a model in django it no longer picks up changes with

python manage.py makemigrations

I did previously delete the database (postgres) via dropdb, and recreated it with createdb. I then deleted the migrations from the apps migrations folder. Before doing this makemigrations did work ok for that app.

What is the best way to fix?

Upvotes: 1

Views: 195

Answers (2)

Paulo Pessoa
Paulo Pessoa

Reputation: 2569

Try this:

python manage.py makemigrations app_name

Or, just add __init__.py file on each migrations folder.

Upvotes: 0

knbk
knbk

Reputation: 53649

Recreate the migrations folder with an __init__.py file. A shortcut for this is to run python manage.py makemigrations <app_label>. The app label here is important, otherwise it will treat your app as an unmigrated app and it won't create any migrations.

Upvotes: 3

Related Questions