I have django application, where I wanted to export all migration from my project , auth and admin to sql query. I am able to do
python manage.py sqlmigrate myapp 0001
However, I want to export all migration at same time rather than explicitly righting loops. Is there any package or tool that i can use for this.
you can use squashmigrations command
python manage.py squashmigrations <appname> <squashfrom> <squashto>
and press y
Delete all the before migration files
then run the following command
python manage.py sqlmigrate <appname> <squash_generated_migartion_file>
if you wanted to see the sql for auth migrations
python manage.py sqlmigrate auth 0001_initial
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With