Answer the question
In order to leave comments, you need to log in
Migrations created, applied, but their files are missing?
I work with a remote server through pycharm, and in order not to spoil either the database or the migration files, I specifically included them in the deployment exceptions. Everything worked fine, but at some point the server went down and the project had to be reloaded, and the migrations were created and applied on the same server. Now, when adding a new model to the database and calling makemigrations, and then migrate, Django says that nothing has changed in the models and there is nothing to pour into the database. Previously, I solved this by deleting the old database and creating a new one, but now this cannot be done, because the database already has data, A LOT of data.
Can you please tell me if it is possible to fix this error without deleting the old database, but simply somehow let Django know that new migration files need to be created?
Answer the question
In order to leave comments, you need to log in
so create 1 initial migration with the current state of affairs. Clear the *_migrations tables in the database, Apply it with --fake (nothing will happen). Further, as usual - after changing the models createmigrations, migrate.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question