Answer the question
In order to leave comments, you need to log in
How to clean up migrations in Django?
Now I put the Django project on the server.
I copied all the files, including the migrations folder. Made a migration.
In one of the migrations, there was a mention of a field that is not in the latest version. But for some reason Django still requests it now. Updating the model.py file and deleting the migrations from both the migrations folder and the folder's cache does nothing.
When you try to makemigration - gives out that there are no changes. How can I drop all migrations from the server and set from scratch?
Answer the question
In order to leave comments, you need to log in
The correct action was to bring the migrations up to date, not delete them. But since it was deleted, connect to the database and clear the migration table with the command
DELETE FROM django_migrations WHERE app='название_приложения';
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question