[Django]-Django migrations: how to generate database from current state of the models (good old syncdb –all)

0👍

you can use --fake flag for doing that. it will ignore all passed migrations and start migrating from now on. like this:

python manage.py migrate --fake

also if you want to set current state of your migrations (for example assume that your last migration on an app is on 0004_… which starts with 0004)

python manage.py migrate --fake my_app 0004

Note

also there are some options too:

python manage.py migrate --fake my_app zero

python manage.py migrate --fake-initial

Leave a comment