Reputation: 12887
I have 2 related questions.
I have deleted all my migrations, including the migrations directory, from all the apps in my project. I've started with a clean database. But still, when I run ./manage.py makemigrations
, django says there are no changes to be made. How do I completely start over with migrations? No squashing, just starting over.
It seems that when I call makemigrations
, django consults the database. I'd like my codebase to be the only source of truth for my migrations. Is there a way to do this?
Upvotes: 1
Views: 724
Reputation: 53699
If an app doesn't have a migrations/
directory with an __init__.py
file (even on Python 3), Django won't create any migrations if you don't specify the app name. You either have to create the directories and __init__.py
files, or you have to call ./manage.py makemigrations <app_name>
for each app, which forces Django to create the directory.
It doesn't. It may connect to the database during the makemigrations
command, but the migrations are purely based on your models.
Upvotes: 2