Issue
I'm bootstrapping a new django project, and my team usually makes a 'setup/reset' script that rebuilds containers as well as drops(unless it doesnt exist yet) and rebuilds the database from scratch.
I found the manage.py flush
command for dropping the data, but I also want to revert all migrations. I could only find a command for rolling back the migrations of a single app at a time:
manage.py migrate <app_name> zero
Is there a way I can do that for every app, or would I have to list them out in the script? We do have the manage.py migrate
command that migrates everything, so I basically just want the opposite of that.
If it's not easily possible, I'll probably just make the db container drop and rebuild the database
Thanks!
Solution
If you have django-extensions, python manage.py reset_db sounds like what you're looking for.
Answered By - yrekkehs
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.