Reputation: 5
I am having DJango migrations problem while making migration following error is coming.
When I run my applications using python manage.py runserver it shows this :-
However, running python manage.py makemigrations shows no changes detected And Above three images are result after running python manage.py migrate. What is the problem with this?
Upvotes: 0
Views: 1235
Reputation: 493
When the *table> already exists Error happens, it is usually due to deleting and rerunning the initial migration or models.py file. For these scenarios,
python manage.py makemigrations <app_name>
python manage.py migrate --fake-initial <app_name>
Or if you want to fake only one migration file
python manage.py migrate <migration_file_number> --fake <app_name>
--fake-initial
tells Django to mark initial migration as migrated without actually running its corresponding SQL.
Django's migration document may be helpful
Upvotes: 0
Reputation: 110
looks like you changed the database or migration files manually. try to re-create the database.
Upvotes: 0