If you don't need the history of the app migrations then it is pretty straightforward, you will basically end up with a squashed migration. If you do need the migration history (there is another system that is not up to sync with yours, etc) you are stuck, and I would suggest you start using a version control system (git, hg, etc)
Assuming it is ok to end up with one squashed migration:
1) Remove any changes you have made in your code that inform the database schema for the app(s) in question(so model changes)
2) Access the database directly (assuming postgres - psql, other databases have different interfaces)
3) There is a table django_migrations with the fields id, app, name, applied. Run a
delete from django_migrations where app = '';
for whatever app you deleted the migrations from (run it a few times if you deleted multiple app migrations)
4) For all the apps you need to rebuild migrations for
./manage makemigrations [app-names]
5)For each app that you needed to rebuild the migrations
./mange migrate [app-name] --fake
This tells the database to write to the dajngo_migrations table that the migration was run, but doesn't actually change the schema. This is why your code and db need to be in sync. Otherwise you will have changes in the migration that are not reflected in the db, but the migtration is marked as having been run
You are now back in shape. Now set up git. I am happy to help or point you to references for it
Kirby
On Wednesday, June 6, 2018 at 8:54:48 AM UTC-4, Leif wrote: